diff options
| author | Thomas Hackl <hackl@data-quest.de> | 2024-06-20 04:52:22 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2024-06-20 04:52:22 +0000 |
| commit | 6b15e09a48e16581d1fd8027fd64d9890a031bdb (patch) | |
| tree | 9f28a4540d62fc567694bc84d0e571b959f8d3a4 /resources/assets/javascripts | |
| parent | d4d5c311ec24ddc92c8d9053f9eeb37acf44f395 (diff) | |
Resolve ""Link zu dieser Veranstaltung kopieren" verwendet einen eigenen Mechanismus"
Closes #4329
Merge request studip/studip!3129
Diffstat (limited to 'resources/assets/javascripts')
| -rw-r--r-- | resources/assets/javascripts/bootstrap/copyable_links.js | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/resources/assets/javascripts/bootstrap/copyable_links.js b/resources/assets/javascripts/bootstrap/copyable_links.js index 521eae4..b4f6fc6 100644 --- a/resources/assets/javascripts/bootstrap/copyable_links.js +++ b/resources/assets/javascripts/bootstrap/copyable_links.js @@ -16,24 +16,8 @@ $(document).on('click', 'a.copyable-link', function (event) { document.execCommand('Copy'); dummy.remove(); - // Show visual hint using a deferred (this way we don't need to - // duplicate the functionality in the done() handler) - (new Promise((resolve, reject) => { - let confirmation = $('<div class="copyable-link-confirmation copyable-link-success">'); - confirmation.text($gettext('Link wurde kopiert')); - confirmation.insertBefore('#content'); - - // Resolve deferred when animation has ended or after 2 seconds as a - // fail safe - let timeout = setTimeout(() => { - $(this).parent().off('animationend'); - resolve(confirmation); - }, 1500); - $(this).parent().one('animationend', () => { - clearTimeout(timeout); - resolve(confirmation); - }); - })).then((confirmation, parent) => { - confirmation.remove(); - }); + STUDIP.eventBus.emit( + 'push-system-notification', + { type: 'success', message: $gettext('Link wurde kopiert') } + ); }); |
