mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
new share admin page (#1233)
This commit is contained in:
@@ -125,19 +125,22 @@ define([
|
||||
sortByName: function() {
|
||||
$('.by-time .sort-icon', this.$table).hide();
|
||||
var repos = this.repos;
|
||||
var el = $('.by-name .sort-icon', 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')) {
|
||||
var $el = $('.by-name .sort-icon', this.$table);
|
||||
if ($el.hasClass('icon-caret-up')) {
|
||||
repos.comparator = function(a, b) { // a, b: model
|
||||
var result = Common.compareTwoWord(a.get('name'), b.get('name'));
|
||||
return -result;
|
||||
} else {
|
||||
};
|
||||
} else {
|
||||
repos.comparator = function(a, b) { // a, b: model
|
||||
var result = Common.compareTwoWord(a.get('name'), b.get('name'));
|
||||
return result;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
repos.sort();
|
||||
this.$tableBody.empty();
|
||||
repos.each(this.addOne, this);
|
||||
el.toggleClass('icon-caret-up icon-caret-down').show();
|
||||
$el.toggleClass('icon-caret-up icon-caret-down').show();
|
||||
repos.comparator = null;
|
||||
return false;
|
||||
},
|
||||
@@ -145,18 +148,20 @@ define([
|
||||
sortByTime: function() {
|
||||
$('.by-name .sort-icon', this.$table).hide();
|
||||
var repos = this.repos;
|
||||
var el = $('.by-time .sort-icon', this.$table);
|
||||
repos.comparator = function(a, b) { // a, b: model
|
||||
if (el.hasClass('icon-caret-down')) {
|
||||
var $el = $('.by-time .sort-icon', this.$table);
|
||||
if ($el.hasClass('icon-caret-down')) {
|
||||
repos.comparator = function(a, b) { // a, b: model
|
||||
return a.get('mtime') < b.get('mtime') ? 1 : -1;
|
||||
} else {
|
||||
};
|
||||
} else {
|
||||
repos.comparator = function(a, b) { // a, b: model
|
||||
return a.get('mtime') < b.get('mtime') ? -1 : 1;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
repos.sort();
|
||||
this.$tableBody.empty();
|
||||
repos.each(this.addOne, this);
|
||||
el.toggleClass('icon-caret-up icon-caret-down').show();
|
||||
$el.toggleClass('icon-caret-up icon-caret-down').show();
|
||||
repos.comparator = null;
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user