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.
This commit is contained in:
@@ -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 () {
|
||||||
|
|||||||
Reference in New Issue
Block a user