Add ignorecase option to tree.

This commit is contained in:
Lars Jung 2015-05-16 14:28:54 +02:00
parent 673afead73
commit 76c226c57b
3 changed files with 11 additions and 2 deletions

View file

@ -4,7 +4,8 @@ modulejs.define('ext/tree', ['_', '$', 'core/event', 'core/location', 'core/reso
enabled: false,
show: true,
maxSubfolders: 50,
naturalSort: false
naturalSort: false,
ignorecase: true
}, allsettings.tree);
var template =
'<div class="item">' +
@ -31,6 +32,11 @@ modulejs.define('ext/tree', ['_', '$', 'core/event', 'core/location', 'core/reso
var val1 = item1.label;
var val2 = item2.label;
if (settings.ignorecase) {
val1 = val1.toLowerCase();
val2 = val2.toLowerCase();
}
return settings.natural ? util.naturalCmpFn(val1, val2) : util.regularCmpFn(val1, val2);
}