diff --git a/source/UI/js/Core/Fullscreen.js b/source/UI/js/Core/Fullscreen.js index 6f8b97cc..5b414a1b 100644 --- a/source/UI/js/Core/Fullscreen.js +++ b/source/UI/js/Core/Fullscreen.js @@ -110,6 +110,7 @@ Ox.Fullscreen = (function() { // FIXME: Why does storing the function in a variable not work? // enter && enter(); // ^ Missing `this` binding + that.element = element }; that.exit = function() { @@ -123,6 +124,7 @@ Ox.Fullscreen = (function() { // FIXME: Why does storing the function in a variable not work? // exit && exit(); // ^ Missing `this` binding + delete that.element }; that.getState = function() { diff --git a/source/UI/js/Form/Picker.js b/source/UI/js/Form/Picker.js index 78037d0e..f47a38c8 100644 --- a/source/UI/js/Form/Picker.js +++ b/source/UI/js/Form/Picker.js @@ -95,7 +95,7 @@ Ox.Picker = function(options, self) { .css({ borderRadius: '8px 8px 0 0' }); - self.$layer.appendTo(Ox.$body); + self.$layer.appendTo(Ox.Fullscreen.element ? Ox.Fullscreen.element : Ox.$body); self.$menu .css({ left: left + 'px', diff --git a/source/UI/js/Menu/Menu.js b/source/UI/js/Menu/Menu.js index 492ad340..d3f5f439 100644 --- a/source/UI/js/Menu/Menu.js +++ b/source/UI/js/Menu/Menu.js @@ -826,8 +826,9 @@ Ox.Menu = function(options, self) { if (!that.is(':hidden')) { return; } - that.parent().length == 0 && that.appendTo(Ox.$body); + that.appendTo(Ox.Fullscreen.element ? Ox.Fullscreen.element : Ox.$body); that.css({ + position: 'fixed', left: '-1000px', top: '-1000px' }).show(); diff --git a/source/UI/js/Window/Dialog.js b/source/UI/js/Window/Dialog.js index 0d8ed1dd..30a44a58 100644 --- a/source/UI/js/Window/Dialog.js +++ b/source/UI/js/Window/Dialog.js @@ -70,7 +70,7 @@ Ox.Dialog = function(options, self) { } }) .hide() - .appendTo(Ox.$body); + .appendTo(Ox.Fullscreen.element ? Ox.Fullscreen.element : Ox.$body); self.hasButtons = !!self.options.buttons.length; self.barsHeight = 24 + 24 * self.hasButtons; diff --git a/source/UI/js/Window/Layer.js b/source/UI/js/Window/Layer.js index 2725b707..bf47735f 100644 --- a/source/UI/js/Window/Layer.js +++ b/source/UI/js/Window/Layer.js @@ -55,7 +55,7 @@ Ox.Layer = function(options, self) { if (self.options.type == 'dialog') { Ox.$window.on({mouseup: mouseup}); } - that.appendTo(Ox.$body); + that.appendTo(Ox.Fullscreen.element ? Ox.Fullscreen.element : Ox.$body); return that; } diff --git a/source/UI/js/Window/Tooltip.js b/source/UI/js/Window/Tooltip.js index 50d5dd40..01e8ecba 100644 --- a/source/UI/js/Window/Tooltip.js +++ b/source/UI/js/Window/Tooltip.js @@ -79,7 +79,7 @@ Ox.Tooltip = function(options, self) { self.y = y; } $('.OxTooltip').detach(); // fixme: don't use DOM - that.appendTo(Ox.$body); + that.appendTo(Ox.Fullscreen.element ? Ox.Fullscreen.element : Ox.$body); width = that.width(); height = that.height(); left = Ox.limit(