Changeset 28937
- Timestamp:
- Jul 4, 2014, 9:53:45 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/themes/default/js/LocalStorageCache.js
r28613 r28937 219 219 options = options || {}; 220 220 221 options.filter = function(cats) { 222 cats.map(function(c) { 223 c.pos = c.global_rank.split('.'); 224 }); 225 226 cats.sort(function(a, b) { 227 var i = 0; 228 while (a.pos[i] && b.pos[i]) { 229 if (a.pos[i] != b.pos[i]) { 230 return a.pos[i] - b.pos[i]; 231 } 232 i++; 233 } 234 return (!a.pos[i] && b.pos[i]) ? -1 : 1; 235 }); 236 237 cats.map(function(c, i) { 238 c.pos = i; 239 }); 240 241 return cats; 242 }; 243 221 244 $target.selectize({ 222 245 valueField: 'id', 223 246 labelField: 'fullname', 224 sortField: ' global_rank',247 sortField: 'pos', 225 248 searchField: ['fullname'], 226 249 plugins: ['remove_button'],
Note: See TracChangeset
for help on using the changeset viewer.