From 54ad6da1af26849f56633dbac0a0dea8cea1b115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Fri, 4 Feb 2022 14:18:53 +0200 Subject: [PATCH] HTML Tree: make tooltip setting code use any parent xul node --- chrome/content/zotero/components/virtualized-table.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/components/virtualized-table.jsx b/chrome/content/zotero/components/virtualized-table.jsx index f25d10e7ff..3f4cc53a5e 100644 --- a/chrome/content/zotero/components/virtualized-table.jsx +++ b/chrome/content/zotero/components/virtualized-table.jsx @@ -997,7 +997,11 @@ class VirtualizedTable extends React.Component { */ _setXulTooltip() { // Make sure container xul element has a tooltip set - let xulElem = this._topDiv.closest('.virtualized-table-container'); + let xulElem = this._topDiv; + while (xulElem && xulElem.namespaceURI !== "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") { + xulElem = xulElem.parentElement; + } + if (!xulElem) return; if (xulElem.getAttribute('tooltip') != 'html-tooltip') { xulElem.setAttribute('tooltip', 'html-tooltip'); } @@ -1008,6 +1012,7 @@ class VirtualizedTable extends React.Component { let tooltipTitleNode = document.tooltipNode.closest('div *[title], iframe *[title], browser *[title]'); if (document.tooltipNode && tooltipTitleNode) { this.setAttribute('label', tooltipTitleNode.getAttribute('title')); + return; } e.preventDefault(); });