summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorRemco Brenninkmeijer <requist1@starmail.nl>2014-07-16 21:52:08 +0200
committerRemco Brenninkmeijer <requist1@starmail.nl>2014-07-16 21:52:08 +0200
commit742589fe01259331baee53e6a5bb3be34a9c8e61 (patch)
tree6d6cbe93501f37cd3e52738b7daaa690fec9c593 /apps/files/js
parent1a65d09f708f35e9c38e4e75564f5ac54b136f22 (diff)
downloadnextcloud-server-742589fe01259331baee53e6a5bb3be34a9c8e61.tar.gz
nextcloud-server-742589fe01259331baee53e6a5bb3be34a9c8e61.zip
Show sorting icons when hovering over
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js25
1 files changed, 18 insertions, 7 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 9f43045d502..12af5593898 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -20,7 +20,7 @@
FileList.prototype = {
SORT_INDICATOR_ASC_CLASS: 'icon-triangle-s',
SORT_INDICATOR_DESC_CLASS: 'icon-triangle-n',
-
+
id: 'files',
appName: t('files', 'Files'),
isEmpty: true,
@@ -380,7 +380,7 @@
}
},
- /**
+ /**
* Event handler when clicking on a bread crumb
*/
_onClickBreadCrumb: function(e) {
@@ -908,21 +908,32 @@
* @param sort sort attribute name
* @param direction sort direction, one of "asc" or "desc"
*/
- setSort: function(sort, direction) {
+ setSort: function(sort, direction, show) {
var comparator = FileList.Comparators[sort] || FileList.Comparators.name;
- this._sort = sort;
+ this._show = true;
+ this._sort = sort;
this._sortDirection = (direction === 'desc')?'desc':'asc';
this._sortComparator = comparator;
+
if (direction === 'desc') {
this._sortComparator = function(fileInfo1, fileInfo2) {
return -comparator(fileInfo1, fileInfo2);
};
}
this.$el.find('thead th .sort-indicator')
- .removeClass(this.SORT_INDICATOR_ASC_CLASS + ' ' + this.SORT_INDICATOR_DESC_CLASS);
- this.$el.find('thead th.column-' + sort + ' .sort-indicator')
- .addClass(direction === 'desc' ? this.SORT_INDICATOR_DESC_CLASS : this.SORT_INDICATOR_ASC_CLASS);
+ .removeClass(this.SORT_INDICATOR_ASC_CLASS)
+ .removeClass(this.SORT_INDICATOR_DESC_CLASS)
+ .toggleClass('hidden', !show)
+ .addClass(this.SORT_INDICATOR_DESC_CLASS);
+
+ this.$el.find('thead th.column-' + sort + ' .sort-indicator')
+ .removeClass(this.SORT_INDICATOR_ASC_CLASS)
+ .removeClass(this.SORT_INDICATOR_DESC_CLASS)
+ .toggleClass('hidden', show)
+ .addClass(direction === 'desc' ? this.SORT_INDICATOR_DESC_CLASS : this.SORT_INDICATOR_ASC_CLASS);
},
+
+
/**
* Reloads the file list using ajax call
*