Improve sort button in drive

pull/1/head
yflory 5 years ago
parent 6e30a7546d
commit 1a54f87b5b

@ -2141,8 +2141,17 @@ define([
var show = function () {
var wh = $(window).height();
var topPos = $container[0].getBoundingClientRect().bottom;
$innerblock.css('max-height', Math.floor(wh - topPos - 1)+'px');
var button = $button[0].getBoundingClientRect();
var topPos = button.bottom;
$innerblock.css('bottom', '');
if (config.noscroll) {
var h = $innerblock.outerHeight();
if ((topPos + h) > wh) {
$innerblock.css('bottom', button.height+'px');
}
} else {
$innerblock.css('max-height', Math.floor(wh - topPos - 1)+'px');
}
$innerblock.show();
$innerblock.find('.cp-dropdown-element-active').removeClass('cp-dropdown-element-active');
if (config.isSelect && value) {

@ -2748,21 +2748,22 @@ define([
var options = [{
tag: 'a',
attributes: {'class': 'cp-app-drive-element-type'},
content: Messages.fm_type
content: '<i class="fa fa-minus"></i>' + Messages.fm_type
},{
tag: 'a',
attributes: {'class': 'cp-app-drive-element-atime'},
content: Messages.fm_lastAccess
content: '<i class="fa fa-minus"></i>' + Messages.fm_lastAccess
},{
tag: 'a',
attributes: {'class': 'cp-app-drive-element-ctime'},
content: Messages.fm_creation
content: '<i class="fa fa-minus"></i>' + Messages.fm_creation
}];
var dropdownConfig = {
text: '', // Button initial text
options: options, // Entries displayed in the menu
container: $fhSort,
left: true,
noscroll: true,
common: common
};
var $sortBlock = UIElements.createDropdown(dropdownConfig);
@ -2805,7 +2806,7 @@ define([
if (APP.store[SORT_FILE_BY] === '') { classSorted = 'cp-app-drive-sort-filename'; }
else if (APP.store[SORT_FILE_BY]) { classSorted = 'cp-app-drive-element-' + APP.store[SORT_FILE_BY]; }
if (classSorted) {
$list.find('.' + classSorted).addClass('cp-app-drive-sort-active').prepend($icon);
$list.find('.' + classSorted).addClass('cp-app-drive-sort-active').prepend($icon).find('i').hide();
}
};
var getFileListHeader = function (clickable) {

Loading…
Cancel
Save