From 49ac7ebc6f41da694248427f2dce251483c5e650 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 9 Jun 2021 18:22:40 +0800 Subject: [PATCH] sort out zIndex and hunting for tooltips --- docs/src/Roo_bootstrap_Popover.js.html | 9 +------- docs/src/Roo_bootstrap_Tooltip.js.html | 29 ++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/docs/src/Roo_bootstrap_Popover.js.html b/docs/src/Roo_bootstrap_Popover.js.html index a2191c44a9..242dee1227 100644 --- a/docs/src/Roo_bootstrap_Popover.js.html +++ b/docs/src/Roo_bootstrap_Popover.js.html @@ -287,14 +287,7 @@ this.render(document.body); } - var x = this.alignEl.dom; - while (x && "auto" ==getComputedStyle(x).zIndex) { - //Roo.log(getComputedStyle(x).zIndex ); - x = x.parentNode; - } - if (x) { - this.el.dom.style.zIndex = (1*getComputedStyle(x).zIndex) + 1000; - } + if (this.title === false) { diff --git a/docs/src/Roo_bootstrap_Tooltip.js.html b/docs/src/Roo_bootstrap_Tooltip.js.html index 8ef01b7564..249b3fd34b 100644 --- a/docs/src/Roo_bootstrap_Tooltip.js.html +++ b/docs/src/Roo_bootstrap_Tooltip.js.html @@ -78,9 +78,18 @@ } var bindEl = el; + var pel = false; + if (!el.attr('tooltip')) { + pel = el.findParent("[tooltip]"); + if (pel) { + bindEl = Roo.get(pel); + } + } + + // you can not look for children, as if el is the body.. then everythign is the child.. - if (!el.attr('tooltip')) { // + if (!pel && !el.attr('tooltip')) { // if (!el.select("[tooltip]").elements.length) { return; } @@ -94,7 +103,7 @@ //Roo.log("child element over.."); } - this.currentEl = bindEl; + this.currentEl = el; this.currentTip.bind(bindEl); this.currentRegion = Roo.lib.Region.getRegion(dom); this.currentTip.enter(); @@ -286,6 +295,22 @@ } + var elems = document.getElementsByTagName('div'); + var highest = Number.MIN_SAFE_INTEGER || -(Math.pow(2, 53) - 1); + for (var i = 0; i < elems.length; i++) { + var zindex = Number.parseInt( + document.defaultView.getComputedStyle(elems[i], null).getPropertyValue("z-index"), + 10 + ); + if (zindex > highest) { + highest = zindex; + } + } + + + + this.el.dom.style.zIndex = highest; + this.el.alignTo(this.bindEl, align[0],align[1]); //var arrow = this.el.select('.arrow',true).first(); //arrow.set(align[2], -- 2.39.2