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

Unified Diff: include.postload.js

Issue 5474511327592448: Issue 703 - Make sure that z-index of the "Block Element" dialog is the highest in the document (Closed)
Patch Set: Created June 24, 2014, 9:05 a.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
@@ -118,7 +118,15 @@
clickHideFiltersDialog.src = ext.getURL("block.html");
clickHideFiltersDialog.setAttribute("style", "position: fixed !important; visibility: hidden; display: block !important; border: 0px !important;");
clickHideFiltersDialog.style.WebkitBoxShadow = "5px 5px 20px rgba(0,0,0,0.5)";
- clickHideFiltersDialog.style.zIndex = 99999;
+
+ // make sure that the dialog is above everything else, by setting
+ // the z-index to the highest z-index used in the document plus 1
+ clickHideFiltersDialog.style.zIndex = Math.max.apply(null, Array.prototype.map.call(
+ document.all, function(el)
+ {
+ return parseInt(getComputedStyle(el).zIndex) || 0;
+ }
+ )) + 1;
Wladimir Palant 2014/06/24 10:31:39 Please just use the maximum possible value for zIn
Sebastian Noack 2014/06/24 13:07:52 Done.
// Position in upper-left all the time
clickHideFiltersDialog.style.left = "50px";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld