Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.postload.js

Issue 5859059588661248: Issue 2077 - Inject overlays with highest possible z-index (Closed)
Patch Set: Created April 8, 2015, 1:28 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.postload.js
===================================================================
--- a/include.postload.js
+++ b/include.postload.js
@@ -222,9 +222,7 @@
// Adds an overlay to an element, which is probably a Flash object
function addElementOverlay(elt) {
- var zIndex = "auto";
var position = "absolute";
-
var offsetX = window.scrollX;
var offsetY = window.scrollY;
@@ -244,18 +242,6 @@
position = "fixed";
offsetX = offsetY = 0;
}
-
- // Determine the effective z-index, which is the highest z-index used
- // by the element and its offset ancestors, and increase it by one.
- // When using a lower z-index the element would cover the overlay.
- // When using a higher z-index the overlay might also cover other elements.
- if (style.position != "static" && style.zIndex != "auto")
- {
- var curZIndex = parseInt(style.zIndex, 10) + 1;
-
- if (zIndex == "auto" || curZIndex > zIndex)
- zIndex = curZIndex;
- }
}
var overlay = document.createElement('div');
@@ -268,7 +254,7 @@
overlay.style.left = (rect.left + offsetX) + "px";
overlay.style.top = (rect.top + offsetY) + "px";
overlay.style.position = position;
- overlay.style.zIndex = zIndex;
+ overlay.style.zIndex = 0x7FFFFFFE;
kzar 2015/04/08 14:12:22 Hang on, shouldn't that be 0x7FFFFFFF?
Sebastian Noack 2015/04/08 14:32:45 No, 0x7FFFFFFF is the z-index of the dialog which
kzar 2015/04/08 14:33:40 Gotya.
// elt.parentNode.appendChild(overlay, elt);
document.documentElement.appendChild(overlay);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld