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