[Rt-commit] rt branch 5.0-releng/hide-tooltip-on-click created. rt-5.0.4beta1-7-gb336808423

BPS Git Server git at git.bestpractical.com
Wed May 3 14:54:30 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0-releng/hide-tooltip-on-click has been created
        at  b336808423c36b1a3ac207c10b5c485d76ffe2b8 (commit)

- Log -----------------------------------------------------------------
commit b336808423c36b1a3ac207c10b5c485d76ffe2b8
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed May 3 10:51:21 2023 -0400

    Hide tooltips everywhere on click
    
    When clicking on the filter icon on ticket search results,
    the tooltip remained on the screen, sometimes blocking
    the modal. Add JS to hide tooltips everywhere on click
    and remove some previous individual fixes for the same
    issue.
    
    Keep the dispose for bookmarks as the "Remove" tooltip
    persists and is visible behind "Add" when toggling
    back and forth if dispose isn't called to clean it up.

diff --git a/share/static/js/forms.js b/share/static/js/forms.js
index cfb3b3071a..bf12c95406 100644
--- a/share/static/js/forms.js
+++ b/share/static/js/forms.js
@@ -33,13 +33,6 @@ jQuery(function() {
         }).on('click', '.remove', function (e) {
             e.preventDefault();
             jQuery(e.target).closest('li').remove();
-
-            // dispose of the bootstrap tooltip.
-            // without manually clearing here, the tooltip lingers after clicking remove.
-            var bs_tooltip = jQuery('div[id^="tooltip"]');
-            bs_tooltip.tooltip('hide');
-            bs_tooltip.tooltip('dispose');
-
             return false;
         });
 
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 842ee3ecd9..32fb5b0fd2 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -1203,7 +1203,6 @@ jQuery(function () {
 
     var cancelInlineEdit = function (editor) {
         var cell = editor.closest('td');
-        cell.find('[data-toggle=tooltip]').tooltip('hide');
 
         cell.removeClass('editing');
         editor.get(0).reset();
@@ -1217,7 +1216,6 @@ jQuery(function () {
 
     var submitInlineEdit = function (editor) {
         var cell = editor.closest('td');
-        cell.find('[data-toggle=tooltip]').tooltip('hide');
 
         if (!inlineEditEnabled) {
             return;
@@ -1419,15 +1417,19 @@ jQuery(function() {
         selector: '[data-toggle=tooltip]',
         trigger: 'hover focus'
     });
+
+    // Hide the tooltip everywhere when the element is clicked
+    jQuery('[data-toggle="tooltip"]').click(function () {
+        jQuery('[data-toggle="tooltip"]').tooltip("hide");
+    });
 });
 
 // toggle bookmark for Ticket/Elements/Bookmark.
-// before replacing the bookmark content, hide then dispose of the existing tooltip to
+// before replacing the bookmark content, dispose of the existing tooltip to
 // ensure the tooltips are cycled correctly.
 function toggle_bookmark(url, id) {
     jQuery.get(url, function(data) {
         var bs_tooltip = jQuery('div[id^="tooltip"]');
-        bs_tooltip.tooltip('hide');
         bs_tooltip.tooltip('dispose');
         jQuery('.toggle-bookmark-' + id).replaceWith(data);
     });

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list