diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 6eaa82aae..60666a6c0 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1424,6 +1424,9 @@ define([ }; var show = function () { + var wh = $(window).height(); + var topPos = $container[0].getBoundingClientRect().bottom; + $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) { diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 976bd6303..ba93c8fb1 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -931,7 +931,7 @@ Messenger, MessengerUI, Messages) { var initClickEvents = function (toolbar) { var removeDropdowns = function () { window.setTimeout(function () { - toolbar.$toolbar.find('.cp-dropdown-content').hide(); + $('body').find('.cp-dropdown-content').hide(); }); }; var cancelEditTitle = function (e) { diff --git a/www/drive/inner.js b/www/drive/inner.js index b8e8fe4d0..805dde599 100644 --- a/www/drive/inner.js +++ b/www/drive/inner.js @@ -3011,13 +3011,15 @@ define([ $categories.scrollTop(s); }; - APP.hideMenu = function () { + APP.hideMenu = function (e) { $contextMenu.hide(); $trashTreeContextMenu.hide(); $trashContextMenu.hide(); $contentContextMenu.hide(); $defaultContextMenu.hide(); - $('.cp-dropdown-content').hide(); + if (!e || !$(e.target).parents('.cp-dropdown')) { + $('.cp-dropdown-content').hide(); + } }; var stringifyPath = function (path) { @@ -3297,7 +3299,6 @@ define([ $appContainer.on('click', function (e) { if (e.which !== 1) { return ; } removeInput(); - hideNewButton(); }); $appContainer.on('drag drop', function (e) { removeInput();