mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-12 10:21:02 +00:00
[popup] Make sure the screen and the container have a higher z-index than any other element on the page
This commit is contained in:
parent
051241484a
commit
f60779518d
2 changed files with 18 additions and 4 deletions
|
|
@ -1,7 +1,6 @@
|
|||
.ui-popup-container {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
z-index: 100 !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
|
|
@ -13,4 +12,4 @@
|
|||
position:absolute;
|
||||
top:-15px;
|
||||
right:-15px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,8 +204,22 @@ $.widget("mobile.popup", $.mobile.widget, {
|
|||
if (!this._isOpen) {
|
||||
var self = this,
|
||||
coords = this._placementCoords(
|
||||
(undefined === x ? window.innerWidth / 2 : x),
|
||||
(undefined === y ? window.innerWidth / 2 : y));
|
||||
(undefined === x ? window.innerWidth / 2 : x),
|
||||
(undefined === y ? window.innerHeight / 2 : y)),
|
||||
zIndexMax = 0;
|
||||
|
||||
$(document)
|
||||
.find("*")
|
||||
.each(function() {
|
||||
var el = $(this),
|
||||
zIndex = parseInt(el.css("z-index"));
|
||||
|
||||
if (!(el.is(self._ui.container) || el.is(self._ui.screen) || isNaN(zIndex)))
|
||||
zIndexMax = Math.max(zIndexMax, zIndex);
|
||||
});
|
||||
|
||||
this._ui.screen.css("z-index", (zIndexMax + 1));
|
||||
this._ui.container.css("z-index", (zIndexMax + 2));
|
||||
|
||||
this._ui.screen
|
||||
.height($(document).height())
|
||||
|
|
@ -244,6 +258,7 @@ $.widget("mobile.popup", $.mobile.widget, {
|
|||
self._ui.screen.addClass("ui-screen-hidden");
|
||||
self._isOpen = false;
|
||||
self.element.trigger("closed");
|
||||
self._ui.screen.removeAttr("style");
|
||||
};
|
||||
|
||||
this._ui.container
|
||||
|
|
|
|||
Loading…
Reference in a new issue