From 5e200c6ed9b877e7b0ab39ecc422be25995f6432 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 14 May 2020 14:17:34 +0300 Subject: [PATCH] [desktop] fix bug 45266 --- apps/common/main/lib/component/Menu.js | 15 +++++++++++---- apps/common/main/lib/util/utils.js | 4 +++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index e5ee14ebc..e528612c6 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -571,6 +571,8 @@ define([ } } } else { + var cg = Common.Utils.croppedGeometry(); + docH = cg.height - 10; if (top + menuH > docH) { if (fixedAlign && typeof fixedAlign == 'string') { // how to align if menu height > window height m = fixedAlign.match(/^([a-z]+)-([a-z]+)/); @@ -579,13 +581,18 @@ define([ top = docH - menuH; } - if (top < 0) - top = 0; + + if (top < cg.top) + top = cg.top; } if (this.options.additionalAlign) this.options.additionalAlign.call(this, menuRoot, left, top); - else - menuRoot.css({left: Math.ceil(left), top: Math.ceil(top)}); + else { + var _css = {left: Math.ceil(left), top: Math.ceil(top)}; + if (!(menuH < docH)) _css['margin-top'] = 0; + + menuRoot.css(_css); + } }, clearAll: function() { diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js index 39bbf45a9..85f625e78 100644 --- a/apps/common/main/lib/util/utils.js +++ b/apps/common/main/lib/util/utils.js @@ -216,7 +216,9 @@ Common.Utils = _.extend(new(function() { zoom: function() {return me.zoom;}, topOffset: 0, innerWidth: function() {return me.innerWidth;}, - innerHeight: function() {return me.innerHeight;} + innerHeight: function() {return me.innerHeight;}, + croppedGeometry: function() {return {left:0, top: Common.Utils.InternalSettings.get('window-inactive-area-top'), + width: me.innerWidth, height: me.innerHeight - Common.Utils.InternalSettings.get('window-inactive-area-top')}} } })(), Common.Utils || {});