Skip to content

Commit

Permalink
Merge branch '5.0-releng/hide-tooltip-on-click' into 5.0.4-releng
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed May 3, 2023
2 parents a1ac2e0 + b336808 commit a651fac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
7 changes: 0 additions & 7 deletions share/static/js/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down
10 changes: 6 additions & 4 deletions share/static/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit a651fac

Please sign in to comment.