1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 13:24:52 +00:00

enable sort repo/dirent by Chinese word

This commit is contained in:
lian
2015-04-30 11:59:09 +08:00
parent 801abe9026
commit ca8a449d5a
7 changed files with 56 additions and 11 deletions

View File

@@ -84,10 +84,11 @@ define([
var repos = this.repos;
var el = $('.by-name', this.$table);
repos.comparator = function(a, b) { // a, b: model
var result = Common.compareTwoWord(a.get('name'), b.get('name'));
if (el.hasClass('icon-caret-up')) {
return a.get('name').toLowerCase() < b.get('name').toLowerCase() ? 1 : -1;
return -result;
} else {
return a.get('name').toLowerCase() < b.get('name').toLowerCase() ? -1 : 1;
return result;
}
};
repos.sort();