diff options
-rw-r--r-- | admin/themes/default/js/LocalStorageCache.js | 2 | ||||
-rw-r--r-- | admin/themes/default/js/addAlbum.js | 5 | ||||
-rw-r--r-- | admin/themes/default/template/batch_manager_global.tpl | 6 | ||||
-rw-r--r-- | admin/themes/default/template/cat_modify.tpl | 13 | ||||
-rw-r--r-- | admin/themes/default/template/photos_add_direct.tpl | 6 | ||||
-rw-r--r-- | admin/themes/default/template/picture_modify.tpl | 2 |
6 files changed, 12 insertions, 22 deletions
diff --git a/admin/themes/default/js/LocalStorageCache.js b/admin/themes/default/js/LocalStorageCache.js index c18171efc..b720851be 100644 --- a/admin/themes/default/js/LocalStorageCache.js +++ b/admin/themes/default/js/LocalStorageCache.js @@ -1,5 +1,5 @@ var LocalStorageCache = function(options) { - this.key = options.key + '-' + options.serverId; + this.key = options.key + '_' + options.serverId; this.serverKey = options.serverKey; this.lifetime = options.lifetime ? options.lifetime*1000 : 3600*1000; this.loader = options.loader; diff --git a/admin/themes/default/js/addAlbum.js b/admin/themes/default/js/addAlbum.js index 60942d8a7..dec06532e 100644 --- a/admin/themes/default/js/addAlbum.js +++ b/admin/themes/default/js/addAlbum.js @@ -8,7 +8,7 @@ jQuery.fn.pwgAddAlbum = function(options) { $popup.find('[name="category_parent"]').selectize({ valueField: 'id', labelField: 'fullname', - sortField: 'fullname', + sortField: 'global_rank', searchField: ['fullname'], plugins: ['remove_button'], onInitialize: function() { @@ -107,7 +107,8 @@ jQuery.fn.pwgAddAlbum = function(options) { options.cache.get(function(categories) { categories.push({ id: 0, - fullname: '------------' + fullname: '------------', + global_rank: 0 }); albumParent.selectize.load(function(callback) { diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index 4fdad75d3..4a45cab41 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -134,16 +134,12 @@ jQuery(document).ready(function() {ldelim} jQuery('[data-selectize=categories]').selectize({ valueField: 'id', labelField: 'fullname', - sortField: 'fullname', + sortField: 'global_rank', searchField: ['fullname'], plugins: ['remove_button'] }); categoriesCache.get(function(categories) { - categories.sort(function(a, b) { - return a.fullname.localeCompare(b.fullname); - }); - jQuery('[data-selectize=categories]').each(function() { this.selectize.load(function(callback) { callback(categories); diff --git a/admin/themes/default/template/cat_modify.tpl b/admin/themes/default/template/cat_modify.tpl index 4010aec38..4bb06c03b 100644 --- a/admin/themes/default/template/cat_modify.tpl +++ b/admin/themes/default/template/cat_modify.tpl @@ -20,7 +20,7 @@ var categoriesCache = new LocalStorageCache({ jQuery('[data-selectize=categories]').selectize({ valueField: 'id', labelField: 'fullname', - sortField: 'fullname', + sortField: 'global_rank', searchField: ['fullname'], plugins: ['remove_button'] }); @@ -28,7 +28,8 @@ jQuery('[data-selectize=categories]').selectize({ categoriesCache.get(function(categories) { categories.push({ id: 0, - fullname: '------------' + fullname: '------------', + global_rank: 0 }); // remove itself and children @@ -36,10 +37,6 @@ categoriesCache.get(function(categories) { return !(/\b{$CAT_ID}\b/.test(cat.uppercats)); }); - categories.sort(function(a, b) { - return a.fullname.localeCompare(b.fullname); - }); - jQuery('[data-selectize=categories]').each(function() { this.selectize.load(function(callback) { callback(categories); @@ -51,11 +48,11 @@ categoriesCache.get(function(categories) { // prevent empty value if (this.selectize.getValue() == '') { - this.selectize.setValue(categories[0].id); + this.selectize.setValue(0); } this.selectize.on('dropdown_close', function() { if (this.getValue() == '') { - this.setValue(categories[0].id); + this.setValue(0); } }); }); diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl index 01637818b..fdf80c481 100644 --- a/admin/themes/default/template/photos_add_direct.tpl +++ b/admin/themes/default/template/photos_add_direct.tpl @@ -31,7 +31,7 @@ var categoriesCache = new LocalStorageCache({ jQuery('[data-selectize=categories]').selectize({ valueField: 'id', labelField: 'fullname', - sortField: 'fullname', + sortField: 'global_rank', searchField: ['fullname'], plugins: ['remove_button'] }); @@ -40,10 +40,6 @@ categoriesCache.get(function(categories) { if (categories.length > 0) { jQuery("#albumSelection").show(); } - - categories.sort(function(a, b) { - return a.fullname.localeCompare(b.fullname); - }); jQuery('[data-selectize=categories]').each(function() { this.selectize.load(function(callback) { diff --git a/admin/themes/default/template/picture_modify.tpl b/admin/themes/default/template/picture_modify.tpl index f173abcce..3688d92ff 100644 --- a/admin/themes/default/template/picture_modify.tpl +++ b/admin/themes/default/template/picture_modify.tpl @@ -25,7 +25,7 @@ var categoriesCache = new LocalStorageCache({ jQuery('[data-selectize=categories]').selectize({ valueField: 'id', labelField: 'fullname', - sortField: 'fullname', + sortField: 'global_rank', searchField: ['fullname'], plugins: ['remove_button'] }); |