mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 22:45:14 -04:00
Add ignorecase option to tree.
This commit is contained in:
parent
673afead73
commit
76c226c57b
3 changed files with 11 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
||||||
* adds search
|
* adds search
|
||||||
* adds wide links in tree view
|
* adds wide links in tree view
|
||||||
* adds IE edge mode
|
* adds IE edge mode
|
||||||
|
* adds ignorecase sorting option to tree
|
||||||
* fixes some styles in IE10
|
* fixes some styles in IE10
|
||||||
* fixes preview bottom bar for small screen widths
|
* fixes preview bottom bar for small screen widths
|
||||||
* changes API
|
* changes API
|
||||||
|
|
|
@ -388,11 +388,13 @@ Options
|
||||||
- show: boolean, initial visible to first time users
|
- show: boolean, initial visible to first time users
|
||||||
- maxSubfolders: number, max number of subfolders to show in tree
|
- maxSubfolders: number, max number of subfolders to show in tree
|
||||||
- naturalSort: boolean, use natural sort order for folders
|
- naturalSort: boolean, use natural sort order for folders
|
||||||
|
- ignorecase: boolean, sort ignorecase
|
||||||
*/
|
*/
|
||||||
"tree": {
|
"tree": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"show": true,
|
"show": true,
|
||||||
"maxSubfolders": 50,
|
"maxSubfolders": 50,
|
||||||
"naturalSort": false
|
"naturalSort": false,
|
||||||
|
"ignorecase": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@ modulejs.define('ext/tree', ['_', '$', 'core/event', 'core/location', 'core/reso
|
||||||
enabled: false,
|
enabled: false,
|
||||||
show: true,
|
show: true,
|
||||||
maxSubfolders: 50,
|
maxSubfolders: 50,
|
||||||
naturalSort: false
|
naturalSort: false,
|
||||||
|
ignorecase: true
|
||||||
}, allsettings.tree);
|
}, allsettings.tree);
|
||||||
var template =
|
var template =
|
||||||
'<div class="item">' +
|
'<div class="item">' +
|
||||||
|
@ -31,6 +32,11 @@ modulejs.define('ext/tree', ['_', '$', 'core/event', 'core/location', 'core/reso
|
||||||
var val1 = item1.label;
|
var val1 = item1.label;
|
||||||
var val2 = item2.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);
|
return settings.natural ? util.naturalCmpFn(val1, val2) : util.regularCmpFn(val1, val2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue