diff --git a/qui/classes/QUI.js b/qui/classes/QUI.js index 47c5b2bed281c48f9d1c68a4296ef2088bf116e9..76854fe43a66583bb2b0243318b7ecf7b3220f3c 100644 --- a/qui/classes/QUI.js +++ b/qui/classes/QUI.js @@ -86,14 +86,29 @@ define('qui/classes/QUI', [ this.Windows = new Windows(); this.Storage = new Storage(); + var Ghost = new Element('div', { + styles: { + background: 'transparent', + display : 'none', + height : '100%', + left : 0, + position : 'fixed', + top : 0, + width : '100%', + zIndex : 1 + } + }); + // global resize event if (typeof window !== 'undefined') { - var win = document.id(window); var body = document.id(document.body); win.requestAnimationFrame(function () { - this.$winSize = win.getSize(); + Ghost.setStyle('display', null); + this.$winSize = Ghost.getSize(); + Ghost.setStyle('display', 'none'); + this.$winScroll = win.getScroll(); if (typeof body !== 'undefined' && body) { @@ -112,7 +127,10 @@ define('qui/classes/QUI', [ body = document.id(document.body); } - this.$winSize = win.getSize(); + Ghost.setStyle('display', null); + this.$winSize = Ghost.getSize(); + Ghost.setStyle('display', 'none'); + this.$winScroll = win.getScroll(); this.$bodySize = body.getSize(); this.$bodyScroll = body.getScrollSize(); @@ -126,7 +144,11 @@ define('qui/classes/QUI', [ }.bind(this), 100)); win.addEvent('domready', function () { - this.$winSize = win.getSize(); + Ghost.inject(document.body); + Ghost.setStyle('display', null); + this.$winSize = Ghost.getSize(); + Ghost.setStyle('display', 'none'); + this.$winScroll = win.getScroll(); if (typeof body === 'undefined' || !body) { @@ -310,8 +332,8 @@ define('qui/classes/QUI', [ var nodes = []; if (typeOf(Parent) === 'elements') { - Parent.getElements('[data-qui]').each(function(elements) { - Array.combine(nodes, elements.filter(function(Node) { + Parent.getElements('[data-qui]').each(function (elements) { + Array.combine(nodes, elements.filter(function (Node) { return Node; })); }); diff --git a/qui/controls/windows/Popup.js b/qui/controls/windows/Popup.js index 869ddde17ad00723bc75869656af7711855c9ebd..699d00abfee44f38b7d1e374f6762647e686cfaf 100644 --- a/qui/controls/windows/Popup.js +++ b/qui/controls/windows/Popup.js @@ -326,7 +326,6 @@ define('qui/controls/windows/Popup', needle, function (QUI, var ios = SystemUtils.iOSversion(); if (ios) { - document.body.setStyles({ overflow : 'hidden', position : 'fixed', @@ -409,7 +408,7 @@ define('qui/controls/windows/Popup', needle, function (QUI, this.fireEvent('resizeBegin', [this]); var self = this, - doc_size = document.body.getSize(), + doc_size = QUI.getWindowSize(), height = this.getOpeningHeight(), width = this.getOpeningWidth(); @@ -704,7 +703,7 @@ define('qui/controls/windows/Popup', needle, function (QUI, * @returns {number} */ getOpeningWidth: function () { - var width = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); + var width = QUI.getWindowSize().x; if (width > this.getAttribute('maxWidth')) { width = this.getAttribute('maxWidth'); @@ -719,7 +718,7 @@ define('qui/controls/windows/Popup', needle, function (QUI, * @returns {number} */ getOpeningHeight: function () { - var height = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); + var height = QUI.getWindowSize().y; if (height > this.getAttribute('maxHeight')) { height = this.getAttribute('maxHeight');