Bug 1749134 - fix error message when toggling containers caused by not removing from gClickAndHoldListenersOnElement, r=jaws

Differential Revision: https://phabricator.services.mozilla.com/D135948
This commit is contained in:
Gijs Kruitbosch 2022-01-17 13:49:05 +00:00
Родитель 7003e86117
Коммит ccec3363d4
1 изменённых файлов: 12 добавлений и 9 удалений

Просмотреть файл

@ -1079,21 +1079,24 @@
popup.setAttribute("position", "after_end");
parent.prepend(popup);
parent.setAttribute("type", "menu");
if (newTabLeftClickOpensContainersMenu) {
gClickAndHoldListenersOnElement.remove(parent);
// Update tooltip text
nodeToTooltipMap[parent.id] = "newTabAlwaysContainer.tooltip";
} else {
gClickAndHoldListenersOnElement.add(parent);
nodeToTooltipMap[parent.id] = "newTabContainer.tooltip";
}
// Update tooltip text
nodeToTooltipMap[parent.id] = newTabLeftClickOpensContainersMenu
? "newTabAlwaysContainer.tooltip"
: "newTabContainer.tooltip";
} else {
nodeToTooltipMap[parent.id] = "newTabButton.tooltip";
parent.removeAttribute("context", "new-tab-button-popup");
}
// evict from tooltip cache
gDynamicTooltipCache.delete(parent.id);
// If containers and press-hold container menu are both used,
// add to gClickAndHoldListenersOnElement; otherwise, remove.
if (containersEnabled && !newTabLeftClickOpensContainersMenu) {
gClickAndHoldListenersOnElement.add(parent);
} else {
gClickAndHoldListenersOnElement.remove(parent);
}
}
break;