From 87d8c69e444d980df2d9bf7b33830ec7f86f538d Mon Sep 17 00:00:00 2001 From: OVSharova Date: Fri, 9 Dec 2022 15:13:58 +0300 Subject: [PATCH 1/4] bug 22445 --- apps/common/main/lib/component/Window.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 5b2d2f430..13c92a12c 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -265,8 +265,8 @@ define([ var top = main_geometry.top + Math.floor((parseInt(main_height) - parseInt(win_height)) / 2); var left = Math.floor((parseInt(main_width) - parseInt(win_width)) / 2); - this.$window.css('left',left); - this.$window.css('top',top); + this.$window.css('left',left < 0 ? 0 : left); + this.$window.css('top',top < 0 ? 0 : top); } function _setVisible() { @@ -658,7 +658,7 @@ define([ this.$window.find('.header').on('mousedown', this.binding.dragStart); this.$window.find('.tool.close').on('click', _.bind(doclose, this)); this.$window.find('.tool.help').on('click', _.bind(dohelp, this)); - + $(window).on('resize', _.bind(_centre, this)); if (!this.initConfig.modal) Common.Gateway.on('processmouse', _.bind(_onProcessMouse, this)); } else { From 3095feaff24c26d6458402514a06f3a3fcba8561 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Tue, 13 Dec 2022 14:36:24 +0300 Subject: [PATCH 2/4] bug 22445 --- apps/common/main/lib/component/Window.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 13c92a12c..6ac6a1413 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -355,6 +355,21 @@ define([ } } + function _onResizeMove(){ + var main_geometry = _readDocumetGeometry(), + main_width = parseInt(main_geometry.width), + main_height = parseInt(main_geometry.height), + win_height = this.getHeight(), + win_width = this.getWidth(), + top = this.getTop(), + left = this.getLeft(); + + top = top + win_height > main_height ? main_height - win_height : top; + left = left + win_width > main_width ? main_width - win_width : left; + + this.$window.css('left', left < 0 ? 0 : left); + this.$window.css('top', top < 0 ? 0 : top); + } /* window resize functions */ function _resizestart(event) { @@ -658,7 +673,7 @@ define([ this.$window.find('.header').on('mousedown', this.binding.dragStart); this.$window.find('.tool.close').on('click', _.bind(doclose, this)); this.$window.find('.tool.help').on('click', _.bind(dohelp, this)); - $(window).on('resize', _.bind(_centre, this)); + $(window).on('resize', _.bind(_onResizeMove, this)); if (!this.initConfig.modal) Common.Gateway.on('processmouse', _.bind(_onProcessMouse, this)); } else { From 84b3e65f30a9155a2a4758f9bed2ca56be769593 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Tue, 13 Dec 2022 16:29:53 +0300 Subject: [PATCH 3/4] bug 22445 --- apps/common/main/lib/component/Window.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 6ac6a1413..f312645cb 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -357,8 +357,8 @@ define([ function _onResizeMove(){ var main_geometry = _readDocumetGeometry(), - main_width = parseInt(main_geometry.width), - main_height = parseInt(main_geometry.height), + main_width = main_geometry.width, + main_height = main_geometry.height, win_height = this.getHeight(), win_width = this.getWidth(), top = this.getTop(), From fd6cd5a2889de9970341267abb356cd61ffc58b4 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Wed, 14 Dec 2022 11:50:16 +0300 Subject: [PATCH 4/4] bug 22445 --- apps/common/main/lib/component/Window.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index f312645cb..ce8de1c2c 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -265,8 +265,10 @@ define([ var top = main_geometry.top + Math.floor((parseInt(main_height) - parseInt(win_height)) / 2); var left = Math.floor((parseInt(main_width) - parseInt(win_width)) / 2); - this.$window.css('left',left < 0 ? 0 : left); - this.$window.css('top',top < 0 ? 0 : top); + this.$window.css({ + left: left < 0 ? 0 : left, + top: top < 0 ? 0 : top + }); } function _setVisible() { @@ -367,8 +369,10 @@ define([ top = top + win_height > main_height ? main_height - win_height : top; left = left + win_width > main_width ? main_width - win_width : left; - this.$window.css('left', left < 0 ? 0 : left); - this.$window.css('top', top < 0 ? 0 : top); + this.$window.css({ + left: left < 0 ? 0 : left, + top: top < 0 ? 0 : top + }); } /* window resize functions */