From b99254cab68239305632c9536ce7380b894d332c Mon Sep 17 00:00:00 2001 From: Gülşah Köse Date: Thu, 18 Apr 2024 16:50:07 +0300 Subject: Prevent opening multiple tooltip on drawing area widgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We see multiple tooltip problem on drawing area widgets. Example case: Add basic shape into a writer document Right click on shape and open Position and Size dialog Select the Rotation tab Hold the rotation angle widget and drag around itself When you inspect the "Rotation Angle" tooltip, count may be 600 We expect only 1. So we prevent to show another tooltip if we have already one. Signed-off-by: Gülşah Köse Change-Id: I2f548f8c7afce8095e83a6faa3722e164f990210 --- browser/src/control/Control.UIManager.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/browser/src/control/Control.UIManager.js b/browser/src/control/Control.UIManager.js index 5df804970a..3ae6dde64d 100644 --- a/browser/src/control/Control.UIManager.js +++ b/browser/src/control/Control.UIManager.js @@ -1712,8 +1712,12 @@ L.Control.UIManager = L.Control.extend({ enableTooltip: function(element) { var elem = $(element); if (window.mode.isDesktop()) { - elem.tooltip(); - elem.click(function() { + if (this._tooltip) { + $('.ui-tooltip').remove(); + this._tooltip = undefined; + } + this._tooltip = elem.tooltip(); + elem.on('mousedown', function() { $('.ui-tooltip').fadeOut(function() { $(this).remove(); }); -- cgit