Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js

Issue 1336623003: [MD settings] updating polymer to 1.1.13 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed Polymer.IronCheckedElementBehavior name Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 Polymer.IronOverlayManager = (function() { 1 Polymer.IronOverlayManager = (function() {
2 2
3 var overlays = []; 3 var overlays = [];
4 var DEFAULT_Z = 10; 4 var DEFAULT_Z = 10;
5 var backdrops = []; 5 var backdrops = [];
6 6
7 // track overlays for z-index and focus managemant 7 // track overlays for z-index and focus managemant
8 function addOverlay(overlay) { 8 function addOverlay(overlay) {
9 var z0 = currentOverlayZ(); 9 var z0 = currentOverlayZ();
10 overlays.push(overlay); 10 overlays.push(overlay);
(...skipping 13 matching lines...) Expand all
24 24
25 function applyOverlayZ(overlay, aboveZ) { 25 function applyOverlayZ(overlay, aboveZ) {
26 setZ(overlay, aboveZ + 2); 26 setZ(overlay, aboveZ + 2);
27 } 27 }
28 28
29 function setZ(element, z) { 29 function setZ(element, z) {
30 element.style.zIndex = z; 30 element.style.zIndex = z;
31 } 31 }
32 32
33 function currentOverlay() { 33 function currentOverlay() {
34 return overlays[overlays.length-1]; 34 var i = overlays.length - 1;
35 while (overlays[i] && !overlays[i].opened) {
36 --i;
37 }
38 return overlays[i];
35 } 39 }
36 40
37 function currentOverlayZ() { 41 function currentOverlayZ() {
38 var z; 42 var z;
39 var current = currentOverlay(); 43 var current = currentOverlay();
40 if (current) { 44 if (current) {
41 var z1 = window.getComputedStyle(current).zIndex; 45 var z1 = window.getComputedStyle(current).zIndex;
42 if (!isNaN(z1)) { 46 if (!isNaN(z1)) {
43 z = Number(z1); 47 z = Number(z1);
44 } 48 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 addOverlay: addOverlay, 86 addOverlay: addOverlay,
83 removeOverlay: removeOverlay, 87 removeOverlay: removeOverlay,
84 currentOverlay: currentOverlay, 88 currentOverlay: currentOverlay,
85 currentOverlayZ: currentOverlayZ, 89 currentOverlayZ: currentOverlayZ,
86 focusOverlay: focusOverlay, 90 focusOverlay: focusOverlay,
87 trackBackdrop: trackBackdrop, 91 trackBackdrop: trackBackdrop,
88 getBackdrops: getBackdrops 92 getBackdrops: getBackdrops
89 }; 93 };
90 94
91 })(); 95 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698