diff --git a/apps/common/main/lib/component/HintManager.js b/apps/common/main/lib/component/HintManager.js index 15b0dec0a..68b9af411 100644 --- a/apps/common/main/lib/component/HintManager.js +++ b/apps/common/main/lib/component/HintManager.js @@ -251,6 +251,8 @@ Common.UI.HintManager = new(function() { }; var _getHints = function() { + var docH = Common.Utils.innerHeight() - 20, + docW = Common.Utils.innerWidth() - 20; if (_currentControls.length === 0) _getControls(); _currentControls.forEach(function(item, index) { @@ -277,6 +279,12 @@ Common.UI.HintManager = new(function() { item.attr('data-hint-direction', 'bottom'); } } + var maxHeight = docH; + if ($('#file-menu-panel').is(':visible') && _currentLevel > 1 && + ($('.fms-flex-apply').is(':visible') || $('#fms-flex-apply').is(':visible')) && + item.closest('.fms-flex-apply').length < 1 && item.closest('#fms-flex-apply').length < 1) { + maxHeight = docH - $('.fms-flex-apply').height(); + } var offsets = item.attr('data-hint-offset'); var applyOffset = offsets === 'big' ? 6 : (offsets === 'medium' ? 4 : (offsets === 'small' ? 2 : 0)); if (applyOffset) { @@ -298,32 +306,31 @@ Common.UI.HintManager = new(function() { offsets = offsets ? item.attr('data-hint-offset').split(',').map(function (item) { return parseInt(item); }) : [0, 0]; } var offset = item.offset(); - if (direction === 'left-top') + var top, left; + if (direction === 'left-top') { + top = offset.top - 10 + offsets[0]; + left = offset.left - 10 + offsets[1]; + } else if (direction === 'top') { + top = offset.top - 18 + offsets[0]; + left = offset.left + (item.outerWidth() - 18) / 2 + offsets[1]; + } else if (direction === 'right') { + top = offset.top + (item.outerHeight() - 18) / 2 + offsets[0]; + left = offset.left + item.outerWidth() + offsets[1]; + } else if (direction === 'left') { + top = offset.top + (item.outerHeight() - 18) / 2 + offsets[0]; + left = offset.left - 18 + offsets[1]; + } else { + top = offset.top + item.outerHeight() + offsets[0]; + left = offset.left + (item.outerWidth() - 18) / 2 + offsets[1]; + } + + if (top < maxHeight && left < docW) { hint.css({ - top: offset.top - 10 + offsets[0], - left: offset.left - 10 + offsets[1] + top: top, + left: left }); - else if (direction === 'top') - hint.css({ - top: offset.top - 18 + offsets[0], - left: offset.left + (item.outerWidth() - 18) / 2 + offsets[1] - }); - else if (direction === 'right') - hint.css({ - top: offset.top + (item.outerHeight() - 18) / 2 + offsets[0], - left: offset.left + item.outerWidth() + offsets[1] - }); - else if (direction === 'left') - hint.css({ - top: offset.top + (item.outerHeight() - 18) / 2 + offsets[0], - left: offset.left - 18 + offsets[1] - }); - else - hint.css({ - top: offset.top + item.outerHeight() + offsets[0], - left: offset.left + (item.outerWidth() - 18) / 2 + offsets[1] - }); - $(document.body).append(hint); + $(document.body).append(hint); + } _currentHints.push(hint); } diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index ac365b2dd..4e9c07772 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -288,7 +288,7 @@ define([ '', '', '', - '', + '', '', '
', '' diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 789ee973f..94fed64a6 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -264,7 +264,7 @@ define([ '', '', '', - '', + '', '', '
', '' diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 415f8ee21..7a3a17670 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -805,7 +805,7 @@ define([ '', '', '', - '', + '', '', '
', '',