mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 01:44:13 +00:00
[lib/dir/file sort] bugfix for new interaction
This commit is contained in:
@@ -450,9 +450,10 @@ define([
|
||||
},
|
||||
|
||||
sortByName: function() {
|
||||
$('.by-time .sort-icon').hide();
|
||||
this.$('.by-time .sort-icon').hide();
|
||||
|
||||
var dirents = this.dir;
|
||||
var el = $('.by-name .sort-icon');
|
||||
var el = this.$('.by-name .sort-icon');
|
||||
|
||||
dirents.comparator = function(a, b) {
|
||||
if (a.get('is_dir') && b.get('is_file')) {
|
||||
@@ -476,9 +477,10 @@ define([
|
||||
},
|
||||
|
||||
sortByTime: function () {
|
||||
$('.by-name .sort-icon').hide();
|
||||
this.$('.by-name .sort-icon').hide();
|
||||
|
||||
var dirents = this.dir;
|
||||
var el = $('.by-time .sort-icon');
|
||||
var el = this.$('.by-time .sort-icon');
|
||||
dirents.comparator = function(a, b) {
|
||||
if (a.get('is_dir') && b.get('is_file')) {
|
||||
return -1;
|
||||
|
@@ -131,9 +131,9 @@ define([
|
||||
},
|
||||
|
||||
sortByName: function() {
|
||||
$('.by-time .sort-icon').hide();
|
||||
this.$('.by-time .sort-icon').hide();
|
||||
var repos = this.repos;
|
||||
var el = $('.by-name .sort-icon', this.$table);
|
||||
var el = this.$('.by-name .sort-icon');
|
||||
repos.comparator = function(a, b) { // a, b: model
|
||||
var result = Common.compareTwoWord(a.get('name'), b.get('name'));
|
||||
if (el.hasClass('icon-caret-up')) {
|
||||
@@ -147,13 +147,12 @@ define([
|
||||
repos.each(this.addOne, this);
|
||||
el.toggleClass('icon-caret-up icon-caret-down').show();
|
||||
repos.comparator = null;
|
||||
|
||||
},
|
||||
|
||||
sortByTime: function() {
|
||||
$('.by-name .sort-icon').hide();
|
||||
this.$('.by-name .sort-icon').hide();
|
||||
var repos = this.repos;
|
||||
var el = $('.by-time .sort-icon', this.$table);
|
||||
var el = this.$('.by-time .sort-icon');
|
||||
repos.comparator = function(a, b) { // a, b: model
|
||||
if (el.hasClass('icon-caret-down')) {
|
||||
return a.get('mtime') < b.get('mtime') ? 1 : -1;
|
||||
|
@@ -139,7 +139,7 @@ define([
|
||||
},
|
||||
|
||||
sortByName: function() {
|
||||
$('.by-time .sort-icon').hide();
|
||||
$('.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
|
||||
@@ -158,7 +158,7 @@ define([
|
||||
},
|
||||
|
||||
sortByTime: function() {
|
||||
$('.by-name .sort-icon').hide();
|
||||
$('.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
|
||||
|
Reference in New Issue
Block a user