[All] fix bug 42729

This commit is contained in:
Maxim Kadushkin 2020-04-23 10:27:13 +03:00
parent 0d719d810d
commit 0aeb3a561d
2 changed files with 18 additions and 8 deletions

View file

@ -239,13 +239,14 @@ define([
if (this.initConfig.height == 'auto') { if (this.initConfig.height == 'auto') {
var win_height = parseInt(this.$window.find('.body').css('height')); var win_height = parseInt(this.$window.find('.body').css('height'));
this.initConfig.header && (win_height += parseInt(this.$window.find('.header').css('height'))); this.initConfig.header && (win_height += parseInt(this.$window.find('.header').css('height')));
} else } else {
win_height = this.initConfig.height; win_height = this.initConfig.height;
win_height > main_height && (win_height = main_height);
}
var win_width = (this.initConfig.width=='auto') ? parseInt(this.$window.find('.body').css('width')) : this.initConfig.width; var win_width = (this.initConfig.width=='auto') ? parseInt(this.$window.find('.body').css('width')) : this.initConfig.width;
var top = Common.Utils.InternalSettings.get('window-inactive-area-top') + var top = main_geometry.top + Math.floor((parseInt(main_height) - parseInt(win_height)) / 2);
Math.floor((parseInt(main_height) - parseInt(win_height)) / 2);
var left = Math.floor((parseInt(main_width) - parseInt(win_width)) / 2); var left = Math.floor((parseInt(main_width) - parseInt(win_width)) / 2);
this.$window.css('left',left); this.$window.css('left',left);
@ -259,9 +260,15 @@ define([
if (this.getLeft() + this.getWidth() > main_width) if (this.getLeft() + this.getWidth() > main_width)
this.$window.css('left', main_width - this.getWidth()); this.$window.css('left', main_width - this.getWidth());
var _top = this.getTop() - main_geometry.top;
if (_top + this.getHeight() > main_height) if (this.getTop() < main_geometry.top )
this.$window.css('top', main_height - this.getHeight()); this.$window.css('top', main_geometry.top);
else
if (this.getTop() + this.getHeight() > main_height) {
if (main_height - this.getHeight() < 0)
this.$window.css('top', main_geometry.top);
else this.$window.css('top', main_geometry.top + main_height - this.getHeight());
}
} }
function _getTransformation(end) { function _getTransformation(end) {
@ -288,7 +295,10 @@ define([
main_height = main_geometry.height; main_height = main_geometry.height;
this.dragging.maxx = main_width - this.getWidth(); this.dragging.maxx = main_width - this.getWidth();
this.dragging.maxy = main_height - this.getHeight() + Common.Utils.InternalSettings.get('window-inactive-area-top'); this.dragging.maxy = main_height - this.getHeight();
if (this.dragging.maxy < 0)
this.dragging.maxy = 0;
this.dragging.maxy += main_geometry.top;
$(document).on('mousemove', this.binding.drag); $(document).on('mousemove', this.binding.drag);
$(document).on('mouseup', this.binding.dragStop); $(document).on('mouseup', this.binding.dragStop);

View file

@ -141,7 +141,7 @@ define([
this.$window.find('> .body').css('height', height-header_height); this.$window.find('> .body').css('height', height-header_height);
this.$window.find('> .body > .box').css('height', height-85); this.$window.find('> .body > .box').css('height', height-85);
var top = (Common.Utils.innerHeight() - parseInt(height)) / 2; var top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2;
var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2; var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2;
this.$window.css('left',left); this.$window.css('left',left);