|
14 | 14 | return contentId; |
15 | 15 | }; |
16 | 16 |
|
| 17 | + Tracy.panelZIndex = Tracy.panelZIndex || 20000; |
| 18 | + |
17 | 19 | var Panel = Tracy.DebugPanel = function(id) { |
18 | 20 | this.id = id; |
19 | 21 | this.elem = document.getElementById(this.id); |
|
24 | 26 | Panel.FLOAT = 'tracy-mode-float'; |
25 | 27 | Panel.WINDOW = 'tracy-mode-window'; |
26 | 28 | Panel.FOCUSED = 'tracy-focused'; |
27 | | - Panel.zIndex = 20001; |
| 29 | + Panel.zIndexCounter = 1; |
28 | 30 |
|
29 | 31 | Panel.prototype.init = function() { |
30 | 32 | var _this = this, elem = this.elem; |
|
105 | 107 | clearTimeout(elem.Tracy.displayTimeout); |
106 | 108 | elem.Tracy.displayTimeout = setTimeout(function() { |
107 | 109 | elem.classList.add(Panel.FOCUSED); |
108 | | - elem.style.zIndex = Panel.zIndex++; |
| 110 | + elem.style.zIndex = Tracy.panelZIndex + Panel.zIndexCounter++; |
109 | 111 | if (callback) { |
110 | 112 | callback(); |
111 | 113 | } |
|
191 | 193 | if (this.is(Panel.WINDOW)) { |
192 | 194 | localStorage.setItem(this.id, JSON.stringify({window: true})); |
193 | 195 | } else if (pos.width) { |
194 | | - localStorage.setItem(this.id, JSON.stringify({right: pos.right, bottom: pos.bottom, zIndex: this.elem.style.zIndex})); |
| 196 | + localStorage.setItem(this.id, JSON.stringify({right: pos.right, bottom: pos.bottom, zIndex: this.elem.style.zIndex - Tracy.panelZIndex})); |
195 | 197 | } else { |
196 | 198 | localStorage.removeItem(this.id); |
197 | 199 | } |
|
208 | 210 | this.init(); |
209 | 211 | this.toFloat(); |
210 | 212 | setPosition(this.elem, pos); |
211 | | - if (pos.zIndex) { |
212 | | - this.elem.style.zIndex = pos.zIndex; |
213 | | - Panel.zIndex = Math.max(Panel.zIndex, pos.zIndex) + 1; |
214 | | - } |
| 213 | + this.elem.style.zIndex = Tracy.panelZIndex + (pos.zIndex || 1); |
| 214 | + Panel.zIndexCounter = Math.max(Panel.zIndexCounter, (pos.zIndex || 1)) + 1; |
215 | 215 | } |
216 | 216 | }; |
217 | 217 |
|
|
0 commit comments