1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

[lib/dir/file sort] bugfix for new interaction

This commit is contained in:
llj
2015-07-11 14:51:26 +08:00
parent f9282585b8
commit 1a406f9b26
4 changed files with 16 additions and 15 deletions

View File

@@ -719,19 +719,19 @@
<script type="text/template" id="my-repos-hd-tmpl">
<tr>
<th width="4%"><!--icon--></th>
<th class="by-name cspt" width="46%">{% trans "Name" %} <span class="sort-icon icon-caret-down hide"></span></th>
<th width="46%" class="by-name cspt">{% trans "Name" %} <span class="sort-icon icon-caret-down hide"></span></th>
<th width="10%"><!--op--></th>
<th width="20%">{% trans "Size" %}</th>
<th class="by-time cspt" width="20%">{% trans "Last Update" %} <span class="sort-icon icon-caret-up"></span></th>
<th width="20%" class="by-time cspt">{% trans "Last Update" %} <span class="sort-icon icon-caret-up"></span></th>
</tr>
</script>
<script type="text/template" id="shared-repos-hd-tmpl">
<tr>
<th width="4%"><!--icon--></th>
<th class="by-name cspt" width="40%">{% trans "Name" %} <span class="sort-icon icon-caret-down hide"></span></th>
<th width="40%" class="by-name cspt">{% trans "Name" %} <span class="sort-icon icon-caret-down hide"></span></th>
<th width="8%"><!--op--></th>
<th width="14%">{% trans "Size" %}</th>
<th class="by-time cspt" width="18%">{% trans "Last Update" %} <span class="sort-icon icon-caret-up"></span></th>
<th width="18%" class="by-time cspt">{% trans "Last Update" %} <span class="sort-icon icon-caret-up"></span></th>
<th width="16%">{% trans "Shared By" %}</th>
</tr>
</script>

View File

@@ -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;

View File

@@ -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;

View File

@@ -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