mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-23 11:43:47 -08:00
Fix multiple tooltip issue
If there are multiple tooltips, they all report the message "copied" because there is no element selection. This fix resolves the issue.
This commit is contained in:
parent
b69364d5ff
commit
9475871edb
|
@ -960,7 +960,13 @@
|
|||
var clipboard = new ClipboardJS('.js-copy-link');
|
||||
|
||||
clipboard.on('success', function(e) {
|
||||
$('.js-copy-link').tooltip('hide').attr('data-original-title', '{{ trans('general.copied') }}').tooltip('show');
|
||||
// Get the clicked element
|
||||
var clickedElement = $(e.trigger);
|
||||
// Get the target element selector from data attribute
|
||||
var targetSelector = clickedElement.data('data-clipboard-target');
|
||||
// Find the target element
|
||||
var targetEl = $(targetSelector);
|
||||
clickedElement.tooltip('hide').attr('data-original-title', '{{ trans('general.copied') }}').tooltip('show');
|
||||
});
|
||||
|
||||
// ignore: 'input[type=hidden]' is required here to validate the select2 lists
|
||||
|
|
Loading…
Reference in a new issue