mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-14 01:19:49 +01:00
Add ignorecase option to tree.
This commit is contained in:
parent
673afead73
commit
76c226c57b
@ -7,6 +7,7 @@
|
||||
* adds search
|
||||
* adds wide links in tree view
|
||||
* adds IE edge mode
|
||||
* adds ignorecase sorting option to tree
|
||||
* fixes some styles in IE10
|
||||
* fixes preview bottom bar for small screen widths
|
||||
* changes API
|
||||
|
@ -388,11 +388,13 @@ Options
|
||||
- show: boolean, initial visible to first time users
|
||||
- maxSubfolders: number, max number of subfolders to show in tree
|
||||
- naturalSort: boolean, use natural sort order for folders
|
||||
- ignorecase: boolean, sort ignorecase
|
||||
*/
|
||||
"tree": {
|
||||
"enabled": true,
|
||||
"show": true,
|
||||
"maxSubfolders": 50,
|
||||
"naturalSort": false
|
||||
"naturalSort": false,
|
||||
"ignorecase": true
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user