Ignore:
Timestamp:
May 26, 2014, 6:56:39 PM (10 years ago)
Author:
mistic100
Message:

feature 3077 : always sort categories by global rank

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    });
Note: See TracChangeset for help on using the changeset viewer.