When Cryptpad.clearTooltips() gets called, don't clear tooltips unless their associated element has gone missing so it won't clear a tip someone is trying to read.

pull/1/head
Caleb James DeLisle 7 years ago
parent f580d9a30a
commit 7a698d092e

@ -301,7 +301,15 @@ define([
// Tooltips // Tooltips
UI.clearTooltips = function () { UI.clearTooltips = function () {
$('.tippy-popper').remove(); // If an element is removed from the UI while a tooltip is applied on that element, the tooltip will get hung
// forever, this is a solution which just searches for tooltips which have no corrisponding element and removes
// them.
var win = $('#pad-iframe')[0].contentWindow;
$('.tippy-popper').each(function (i, el) {
if (win.$('[aria-describedby=' + el.getAttribute('id') + ']').length === 0) {
el.remove();
}
});
}; };
UI.addTooltips = function () { UI.addTooltips = function () {

Loading…
Cancel
Save