Allow sorting in the file dialogue. Fixes #3273

This commit is contained in:
Akshay Joshi authored and Dave Page committed 2018-06-25 14:41:07 +01:00
1 parent 4ba0e1a6f3
commit 1f5ca1b540
6 files changed
+100 -17

No files matched your search

@@ -233,17 +233,6 @@ div.clip {
color: #fff;
}
.file_listing #contents.list th.tablesorter-headerAsc,
.file_listing #contents.list th.tablesorter-headerDesc {
background: rgb(214,212,209); /* Old browsers */
background: -moz-linear-gradient(top, rgba(214,212,209,1) 0%, rgba(244,241,237,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(214,212,209,1)), color-stop(100%,rgba(244,241,237,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(214,212,209,1) 0%,rgba(244,241,237,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(214,212,209,1) 0%,rgba(244,241,237,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(214,212,209,1) 0%,rgba(244,241,237,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(214,212,209,1) 0%,rgba(244,241,237,1) 100%); /* W3C */
}
.file_listing #contents.list td:first-child {
display: table-cell;
padding-left: 0;
@@ -729,3 +718,43 @@ a.dz-remove {
div.change_file_types span {
padding-left:10px;
}
/* overall */
.tablesorter .header,
.tablesorter .tablesorter-header {
/* black (unsorted) double arrow */
background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);
background-repeat: no-repeat;
background-position: center right;
padding: 4px 18px 4px 4px;
white-space: normal;
cursor: pointer;
}
.tablesorter .headerSortUp,
.tablesorter .tablesorter-headerSortUp,
.tablesorter .tablesorter-headerAsc {
/* black asc arrow */
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
}
.tablesorter .headerSortDown,
.tablesorter .tablesorter-headerSortDown,
.tablesorter .tablesorter-headerDesc {
/* black desc arrow */
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
}
.tablesorter thead .sorter-false {
background-image: none;
cursor: default;
padding: 4px;
}
/* table processing indicator */
.tablesorter .tablesorter-processing {
background-position: center center !important;
background-repeat: no-repeat !important;
background-image: url('data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=') !important;
}
@@ -13,6 +13,7 @@ import loading_icon from 'acitree/image/load-root.gif';
define([
'jquery', 'underscore', 'underscore.string', 'pgadmin.alertifyjs',
'sources/gettext', 'sources/url_for', 'dropzone', 'sources/pgadmin',
'tablesorter',
], function($, _, S, Alertify, gettext, url_for, Dropzone, pgAdmin) {
/*---------------------------------------------------------
@@ -574,8 +575,8 @@ define([
result += '</ul>';
} else {
result += '<table id="contents" class="list">';
result += '<thead><tr><th class="headerSortDown">';
result += '<table id="contents" class="list tablesorter">';
result += '<thead><tr><th>';
result += '<span>' + lg.name + '</span></th>';
result += '<th><span>' + lg.size + '</span></th><th>';
result += '<span>' + lg.modified + '</span></th></tr></thead>';
@@ -649,8 +650,8 @@ define([
if ($('.fileinfo').data('view') == 'grid') {
result += '<ul id="contents" class="grid"></ul>';
} else {
result += '<table id="contents" class="list">';
result += '<thead><tr><th class="headerSortDown"><span>' +
result += '<table id="contents" class="list tablesorter">';
result += '<thead><tr><th><span>' +
lg.name + '</span></th><th><span>' + lg.size +
'</span></th><th><span>' + lg.modified +
'</span></th></tr></thead>';
@@ -667,6 +668,13 @@ define([
// Add the new markup to the DOM.
$('.fileinfo .file_listing').html(result);
$('.fileinfo .file_listing #contents').tablesorter({
headers: {
2: {
sorter: 'shortDate',
},
},
});
// rename file/folder
$('.file_manager button.rename').off().on('click', function(e) {