mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 01:41:39 +00:00
[lib/dir/file sort] bugfix for new interaction
This commit is contained in:
@@ -719,19 +719,19 @@
|
|||||||
<script type="text/template" id="my-repos-hd-tmpl">
|
<script type="text/template" id="my-repos-hd-tmpl">
|
||||||
<tr>
|
<tr>
|
||||||
<th width="4%"><!--icon--></th>
|
<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="10%"><!--op--></th>
|
||||||
<th width="20%">{% trans "Size" %}</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>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/template" id="shared-repos-hd-tmpl">
|
<script type="text/template" id="shared-repos-hd-tmpl">
|
||||||
<tr>
|
<tr>
|
||||||
<th width="4%"><!--icon--></th>
|
<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="8%"><!--op--></th>
|
||||||
<th width="14%">{% trans "Size" %}</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>
|
<th width="16%">{% trans "Shared By" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
|
@@ -450,9 +450,10 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
sortByName: function() {
|
sortByName: function() {
|
||||||
$('.by-time .sort-icon').hide();
|
this.$('.by-time .sort-icon').hide();
|
||||||
|
|
||||||
var dirents = this.dir;
|
var dirents = this.dir;
|
||||||
var el = $('.by-name .sort-icon');
|
var el = this.$('.by-name .sort-icon');
|
||||||
|
|
||||||
dirents.comparator = function(a, b) {
|
dirents.comparator = function(a, b) {
|
||||||
if (a.get('is_dir') && b.get('is_file')) {
|
if (a.get('is_dir') && b.get('is_file')) {
|
||||||
@@ -476,9 +477,10 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
sortByTime: function () {
|
sortByTime: function () {
|
||||||
$('.by-name .sort-icon').hide();
|
this.$('.by-name .sort-icon').hide();
|
||||||
|
|
||||||
var dirents = this.dir;
|
var dirents = this.dir;
|
||||||
var el = $('.by-time .sort-icon');
|
var el = this.$('.by-time .sort-icon');
|
||||||
dirents.comparator = function(a, b) {
|
dirents.comparator = function(a, b) {
|
||||||
if (a.get('is_dir') && b.get('is_file')) {
|
if (a.get('is_dir') && b.get('is_file')) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -131,9 +131,9 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
sortByName: function() {
|
sortByName: function() {
|
||||||
$('.by-time .sort-icon').hide();
|
this.$('.by-time .sort-icon').hide();
|
||||||
var repos = this.repos;
|
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
|
repos.comparator = function(a, b) { // a, b: model
|
||||||
var result = Common.compareTwoWord(a.get('name'), b.get('name'));
|
var result = Common.compareTwoWord(a.get('name'), b.get('name'));
|
||||||
if (el.hasClass('icon-caret-up')) {
|
if (el.hasClass('icon-caret-up')) {
|
||||||
@@ -147,13 +147,12 @@ define([
|
|||||||
repos.each(this.addOne, this);
|
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;
|
repos.comparator = null;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
sortByTime: function() {
|
sortByTime: function() {
|
||||||
$('.by-name .sort-icon').hide();
|
this.$('.by-name .sort-icon').hide();
|
||||||
var repos = this.repos;
|
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
|
repos.comparator = function(a, b) { // a, b: model
|
||||||
if (el.hasClass('icon-caret-down')) {
|
if (el.hasClass('icon-caret-down')) {
|
||||||
return a.get('mtime') < b.get('mtime') ? 1 : -1;
|
return a.get('mtime') < b.get('mtime') ? 1 : -1;
|
||||||
|
@@ -139,7 +139,7 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
sortByName: function() {
|
sortByName: function() {
|
||||||
$('.by-time .sort-icon').hide();
|
$('.by-time .sort-icon', this.$table).hide();
|
||||||
var repos = this.repos;
|
var repos = this.repos;
|
||||||
var el = $('.by-name .sort-icon', this.$table);
|
var el = $('.by-name .sort-icon', this.$table);
|
||||||
repos.comparator = function(a, b) { // a, b: model
|
repos.comparator = function(a, b) { // a, b: model
|
||||||
@@ -158,7 +158,7 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
sortByTime: function() {
|
sortByTime: function() {
|
||||||
$('.by-name .sort-icon').hide();
|
$('.by-name .sort-icon', this.$table).hide();
|
||||||
var repos = this.repos;
|
var repos = this.repos;
|
||||||
var el = $('.by-time .sort-icon', this.$table);
|
var el = $('.by-time .sort-icon', this.$table);
|
||||||
repos.comparator = function(a, b) { // a, b: model
|
repos.comparator = function(a, b) { // a, b: model
|
||||||
|
Reference in New Issue
Block a user