Skip to content
Snippets Groups Projects
Commit 6b15e09a authored by Thomas Hackl's avatar Thomas Hackl Committed by David Siegfried
Browse files

Resolve ""Link zu dieser Veranstaltung kopieren" verwendet einen eigenen Mechanismus"

Closes #4329

Merge request studip/studip!3129
parent d4d5c311
No related branches found
No related tags found
No related merge requests found
......@@ -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') }
);
});
.copyable-link-confirmation {
position: fixed;
bottom: 60px;
right: 12px;
height: 60px;
line-height: 60px;
max-width: calc(100% - 140px);
z-index: 42000;
border: solid thin var(--content-color-40);
background-color: var(--white);
background-repeat: no-repeat;
background-position: 1em center;
background-size: 100px;
box-shadow: 5px 5px var(--dark-gray-color-10);
padding: 5px 100px;
transition: transform .5s ease;
&.copyable-link-success {
@include background-icon(check-circle, status-green, 24);
}
&.copyable-link-error {
@include background-icon(decline-circle, status-red, 24);
}
}
......@@ -32,7 +32,6 @@
@import "scss/contents";
@import "scss/content";
@import "scss/comments";
@import "scss/copyable-links";
@import "scss/cronjobs";
@import "scss/coursewizard";
@import "scss/css_tree";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment