aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/bootstrap/copyable_links.js
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
committerPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
commit4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch)
tree5c07151ae61276d334e88f6309c30d439a85c12e /resources/assets/javascripts/bootstrap/copyable_links.js
parentda0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff)
parent97a188592c679890a25c37ab78463add76a52ff7 (diff)
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'resources/assets/javascripts/bootstrap/copyable_links.js')
-rw-r--r--resources/assets/javascripts/bootstrap/copyable_links.js24
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') }
+ );
});