From b29974901c818ff4a32ecaf812827aad8c362c5f Mon Sep 17 00:00:00 2001 From: llj Date: Tue, 14 Jul 2015 11:46:20 +0800 Subject: [PATCH] [sort] new interaction for 'myhome shared libs' --- static/scripts/app/views/myhome-shared-repos.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/static/scripts/app/views/myhome-shared-repos.js b/static/scripts/app/views/myhome-shared-repos.js index a193e89cff..872bc511fe 100644 --- a/static/scripts/app/views/myhome-shared-repos.js +++ b/static/scripts/app/views/myhome-shared-repos.js @@ -100,8 +100,9 @@ define([ }, sortByName: function() { + $('.by-time .sort-icon', this.$table).hide(); var repos = this.repos; - var el = $('.by-name', this.$table); + 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')) { @@ -113,13 +114,14 @@ define([ repos.sort(); this.$tableBody.empty(); repos.each(this.addOne, this); - el.toggleClass('icon-caret-up icon-caret-down'); + el.toggleClass('icon-caret-up icon-caret-down').show(); repos.comparator = null; }, sortByTime: function() { + $('.by-name .sort-icon', this.$table).hide(); var repos = this.repos; - var el = $('.by-time', this.$table); + var el = $('.by-time .sort-icon', this.$table); repos.comparator = function(a, b) { // a, b: model if (el.hasClass('icon-caret-down')) { return a.get('mtime') < b.get('mtime') ? 1 : -1; @@ -130,7 +132,7 @@ define([ repos.sort(); this.$tableBody.empty(); repos.each(this.addOne, this); - el.toggleClass('icon-caret-up icon-caret-down'); + el.toggleClass('icon-caret-up icon-caret-down').show(); repos.comparator = null; }