Changeset 28540


Ignore:
Timestamp:
05/26/14 18:56:39 (5 years ago)
Author:
mistic100
Message:

feature 3077 : always sort categories by global rank

Location:
trunk/admin/themes/default
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/js/LocalStorageCache.js

    r28532 r28540  
    11var LocalStorageCache = function(options) { 
    2   this.key = options.key + '-' + options.serverId; 
     2  this.key = options.key + '_' + options.serverId; 
    33  this.serverKey = options.serverKey; 
    44  this.lifetime = options.lifetime ? options.lifetime*1000 : 3600*1000; 
  • trunk/admin/themes/default/js/addAlbum.js

    r28533 r28540  
    99      valueField: 'id', 
    1010      labelField: 'fullname', 
    11       sortField: 'fullname', 
     11      sortField: 'global_rank', 
    1212      searchField: ['fullname'], 
    1313      plugins: ['remove_button'], 
     
    108108        categories.push({ 
    109109          id: 0, 
    110           fullname: '------------' 
     110          fullname: '------------', 
     111          global_rank: 0 
    111112        }); 
    112113         
  • trunk/admin/themes/default/template/batch_manager_global.tpl

    r28533 r28540  
    135135    valueField: 'id', 
    136136    labelField: 'fullname', 
    137     sortField: 'fullname', 
     137    sortField: 'global_rank', 
    138138    searchField: ['fullname'], 
    139139    plugins: ['remove_button'] 
     
    141141   
    142142  categoriesCache.get(function(categories) { 
    143     categories.sort(function(a, b) { 
    144       return a.fullname.localeCompare(b.fullname); 
    145     }); 
    146      
    147143    jQuery('[data-selectize=categories]').each(function() { 
    148144      this.selectize.load(function(callback) { 
  • trunk/admin/themes/default/template/cat_modify.tpl

    r28533 r28540  
    2121  valueField: 'id', 
    2222  labelField: 'fullname', 
    23   sortField: 'fullname', 
     23  sortField: 'global_rank', 
    2424  searchField: ['fullname'], 
    2525  plugins: ['remove_button'] 
     
    2929  categories.push({ 
    3030    id: 0, 
    31     fullname: '------------' 
     31    fullname: '------------', 
     32    global_rank: 0 
    3233  }); 
    3334   
     
    3536  categories = jQuery.grep(categories, function(cat) { 
    3637    return !(/\b{$CAT_ID}\b/.test(cat.uppercats)); 
    37   }); 
    38    
    39   categories.sort(function(a, b) { 
    40     return a.fullname.localeCompare(b.fullname); 
    4138  }); 
    4239   
     
    5249    // prevent empty value 
    5350    if (this.selectize.getValue() == '') { 
    54       this.selectize.setValue(categories[0].id); 
     51      this.selectize.setValue(0); 
    5552    } 
    5653    this.selectize.on('dropdown_close', function() { 
    5754      if (this.getValue() == '') { 
    58         this.setValue(categories[0].id); 
     55        this.setValue(0); 
    5956      } 
    6057    }); 
  • trunk/admin/themes/default/template/photos_add_direct.tpl

    r28539 r28540  
    3232  valueField: 'id', 
    3333  labelField: 'fullname', 
    34   sortField: 'fullname', 
     34  sortField: 'global_rank', 
    3535  searchField: ['fullname'], 
    3636  plugins: ['remove_button'] 
     
    4141    jQuery("#albumSelection").show(); 
    4242  } 
    43  
    44   categories.sort(function(a, b) { 
    45     return a.fullname.localeCompare(b.fullname); 
    46   }); 
    4743   
    4844  jQuery('[data-selectize=categories]').each(function() { 
  • trunk/admin/themes/default/template/picture_modify.tpl

    r28533 r28540  
    2626  valueField: 'id', 
    2727  labelField: 'fullname', 
    28   sortField: 'fullname', 
     28  sortField: 'global_rank', 
    2929  searchField: ['fullname'], 
    3030  plugins: ['remove_button'] 
Note: See TracChangeset for help on using the changeset viewer.