Remove dropdown menus scrollbar when space is available
This commit is contained in:
parent
8261ad86ae
commit
caa72ba949
3 changed files with 8 additions and 4 deletions
|
@ -1424,6 +1424,9 @@ define([
|
||||||
};
|
};
|
||||||
|
|
||||||
var show = function () {
|
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.show();
|
||||||
$innerblock.find('.cp-dropdown-element-active').removeClass('cp-dropdown-element-active');
|
$innerblock.find('.cp-dropdown-element-active').removeClass('cp-dropdown-element-active');
|
||||||
if (config.isSelect && value) {
|
if (config.isSelect && value) {
|
||||||
|
|
|
@ -931,7 +931,7 @@ Messenger, MessengerUI, Messages) {
|
||||||
var initClickEvents = function (toolbar) {
|
var initClickEvents = function (toolbar) {
|
||||||
var removeDropdowns = function () {
|
var removeDropdowns = function () {
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
toolbar.$toolbar.find('.cp-dropdown-content').hide();
|
$('body').find('.cp-dropdown-content').hide();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var cancelEditTitle = function (e) {
|
var cancelEditTitle = function (e) {
|
||||||
|
|
|
@ -3011,13 +3011,15 @@ define([
|
||||||
$categories.scrollTop(s);
|
$categories.scrollTop(s);
|
||||||
};
|
};
|
||||||
|
|
||||||
APP.hideMenu = function () {
|
APP.hideMenu = function (e) {
|
||||||
$contextMenu.hide();
|
$contextMenu.hide();
|
||||||
$trashTreeContextMenu.hide();
|
$trashTreeContextMenu.hide();
|
||||||
$trashContextMenu.hide();
|
$trashContextMenu.hide();
|
||||||
$contentContextMenu.hide();
|
$contentContextMenu.hide();
|
||||||
$defaultContextMenu.hide();
|
$defaultContextMenu.hide();
|
||||||
$('.cp-dropdown-content').hide();
|
if (!e || !$(e.target).parents('.cp-dropdown')) {
|
||||||
|
$('.cp-dropdown-content').hide();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var stringifyPath = function (path) {
|
var stringifyPath = function (path) {
|
||||||
|
@ -3297,7 +3299,6 @@ define([
|
||||||
$appContainer.on('click', function (e) {
|
$appContainer.on('click', function (e) {
|
||||||
if (e.which !== 1) { return ; }
|
if (e.which !== 1) { return ; }
|
||||||
removeInput();
|
removeInput();
|
||||||
hideNewButton();
|
|
||||||
});
|
});
|
||||||
$appContainer.on('drag drop', function (e) {
|
$appContainer.on('drag drop', function (e) {
|
||||||
removeInput();
|
removeInput();
|
||||||
|
|
Loading…
Reference in a new issue