]> source.dussan.org Git - nextcloud-server.git/commitdiff
Show sorting icons when hovering over
authorRemco Brenninkmeijer <requist1@starmail.nl>
Wed, 16 Jul 2014 19:52:08 +0000 (21:52 +0200)
committerRemco Brenninkmeijer <requist1@starmail.nl>
Wed, 16 Jul 2014 19:52:08 +0000 (21:52 +0200)
apps/files/css/files.css
apps/files/js/filelist.js

index 287dedc23f25f9d7669631a74330b3ac58a7769d..f5fe6819e110be0da174fe5d5c708f50d0b368bd 100644 (file)
@@ -99,7 +99,7 @@
 }
 
 #filestable tbody tr { background-color:#fff; height:40px; }
-#filestable tbody tr:hover, tbody tr:active {
+#filestable tbody tr:hover, tbody tr:active , tbody th:hover, tbody th:active {
        background-color: rgb(240,240,240);
 }
 #filestable tbody tr.selected {
@@ -152,16 +152,20 @@ table th .columntitle.name {
        padding-right: 80px;
        margin-left: 50px;
 }
-/* hover effect on sortable column */
-table th a.columntitle:hover {
-       color: #000;
-}
+
+.sort-indicator.hidden { visibility: hidden; }
 table th .sort-indicator {
        width: 10px;
        height: 8px;
        margin-left: 10px;
        display: inline-block;
 }
+table th:hover .sort-indicator.hidden {
+       width: 10px;
+       height: 8px;
+       margin-left: 10px;
+       visibility: visible;
+}
 table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; }
 table td {
        padding: 0 15px;
index 9f43045d50291a92ee71194029c9c832f149d2b6..12af5593898c51b008c32fc390ac400484f07c1f 100644 (file)
@@ -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,
                        }
                },
 
-               /**
+                /**
                 * Event handler when clicking on a bread crumb
                 */
                _onClickBreadCrumb: function(e) {
                 * @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
                 *