From d13a9ce52dd39f6ae42fe5ae30e61fca19b71ad4 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 26 Feb 2018 00:17:39 +0100 Subject: [PATCH] bar: added Tracy.panelZIndex --- src/Tracy/assets/Bar/bar.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Tracy/assets/Bar/bar.js b/src/Tracy/assets/Bar/bar.js index d1d8b2845..403bf7f4f 100755 --- a/src/Tracy/assets/Bar/bar.js +++ b/src/Tracy/assets/Bar/bar.js @@ -14,6 +14,8 @@ return contentId; }; + Tracy.panelZIndex = Tracy.panelZIndex || 20000; + var Panel = Tracy.DebugPanel = function(id) { this.id = id; this.elem = document.getElementById(this.id); @@ -24,7 +26,7 @@ Panel.FLOAT = 'tracy-mode-float'; Panel.WINDOW = 'tracy-mode-window'; Panel.FOCUSED = 'tracy-focused'; - Panel.zIndex = 20001; + Panel.zIndexCounter = 1; Panel.prototype.init = function() { var _this = this, elem = this.elem; @@ -105,7 +107,7 @@ clearTimeout(elem.Tracy.displayTimeout); elem.Tracy.displayTimeout = setTimeout(function() { elem.classList.add(Panel.FOCUSED); - elem.style.zIndex = Panel.zIndex++; + elem.style.zIndex = Tracy.panelZIndex + Panel.zIndexCounter++; if (callback) { callback(); } @@ -191,7 +193,7 @@ if (this.is(Panel.WINDOW)) { localStorage.setItem(this.id, JSON.stringify({window: true})); } else if (pos.width) { - localStorage.setItem(this.id, JSON.stringify({right: pos.right, bottom: pos.bottom, zIndex: this.elem.style.zIndex})); + localStorage.setItem(this.id, JSON.stringify({right: pos.right, bottom: pos.bottom, zIndex: this.elem.style.zIndex - Tracy.panelZIndex})); } else { localStorage.removeItem(this.id); } @@ -208,10 +210,8 @@ this.init(); this.toFloat(); setPosition(this.elem, pos); - if (pos.zIndex) { - this.elem.style.zIndex = pos.zIndex; - Panel.zIndex = Math.max(Panel.zIndex, pos.zIndex) + 1; - } + this.elem.style.zIndex = Tracy.panelZIndex + (pos.zIndex || 1); + Panel.zIndexCounter = Math.max(Panel.zIndexCounter, (pos.zIndex || 1)) + 1; } };