[desktop] fix bug 45266

This commit is contained in:
Maxim Kadushkin 2020-05-14 14:17:34 +03:00
parent 2af9094a34
commit 5e200c6ed9
2 changed files with 14 additions and 5 deletions

View file

@ -571,6 +571,8 @@ define([
} }
} }
} else { } else {
var cg = Common.Utils.croppedGeometry();
docH = cg.height - 10;
if (top + menuH > docH) { if (top + menuH > docH) {
if (fixedAlign && typeof fixedAlign == 'string') { // how to align if menu height > window height if (fixedAlign && typeof fixedAlign == 'string') { // how to align if menu height > window height
m = fixedAlign.match(/^([a-z]+)-([a-z]+)/); m = fixedAlign.match(/^([a-z]+)-([a-z]+)/);
@ -579,13 +581,18 @@ define([
top = docH - menuH; top = docH - menuH;
} }
if (top < 0)
top = 0; if (top < cg.top)
top = cg.top;
} }
if (this.options.additionalAlign) if (this.options.additionalAlign)
this.options.additionalAlign.call(this, menuRoot, left, top); this.options.additionalAlign.call(this, menuRoot, left, top);
else else {
menuRoot.css({left: Math.ceil(left), top: Math.ceil(top)}); var _css = {left: Math.ceil(left), top: Math.ceil(top)};
if (!(menuH < docH)) _css['margin-top'] = 0;
menuRoot.css(_css);
}
}, },
clearAll: function() { clearAll: function() {

View file

@ -216,7 +216,9 @@ Common.Utils = _.extend(new(function() {
zoom: function() {return me.zoom;}, zoom: function() {return me.zoom;},
topOffset: 0, topOffset: 0,
innerWidth: function() {return me.innerWidth;}, 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 || {}); })(), Common.Utils || {});