Change top position for centered windows.
This commit is contained in:
parent
c792da3342
commit
d01d4e9302
|
@ -225,7 +225,7 @@ define([
|
||||||
|
|
||||||
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 = Math.floor(((parseInt(main_height) - parseInt(win_height)) / 2) * 0.9);
|
var top = 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);
|
||||||
|
|
|
@ -134,7 +134,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) * 0.9;
|
var top = (Common.Utils.innerHeight() - 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);
|
||||||
|
|
|
@ -134,7 +134,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) * 0.9;
|
var top = (Common.Utils.innerHeight() - 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);
|
||||||
|
|
|
@ -422,7 +422,7 @@ define([
|
||||||
Common.UI.Window.prototype.setWidth.call(this, width + borders_width);
|
Common.UI.Window.prototype.setWidth.call(this, width + borders_width);
|
||||||
|
|
||||||
this.$window.css('left',(maxWidth - width - borders_width) / 2);
|
this.$window.css('left',(maxWidth - width - borders_width) / 2);
|
||||||
this.$window.css('top',((maxHeight - height - this._headerFooterHeight) / 2));
|
this.$window.css('top',(maxHeight - height - this._headerFooterHeight) / 2);
|
||||||
},
|
},
|
||||||
|
|
||||||
onWindowResize: function() {
|
onWindowResize: function() {
|
||||||
|
|
|
@ -134,7 +134,7 @@ define([
|
||||||
main_height = Common.Utils.innerHeight();
|
main_height = Common.Utils.innerHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
top = ((parseInt(main_height, 10) - parseInt(win_height, 10)) / 2) * 0.9;
|
top = (parseInt(main_height, 10) - parseInt(win_height, 10)) / 2;
|
||||||
left = (parseInt(main_width, 10) - parseInt(this.initConfig.width, 10)) / 2;
|
left = (parseInt(main_width, 10) - parseInt(this.initConfig.width, 10)) / 2;
|
||||||
|
|
||||||
this.$window.css('left', Math.floor(left));
|
this.$window.css('left', Math.floor(left));
|
||||||
|
|
Loading…
Reference in a new issue