mirror of
https://github.com/wekan/wekan.git
synced 2025-12-30 14:18:48 +01:00
Moved "copied!" code to Utils
- same implementation in all files, so it's better to have one function for it
This commit is contained in:
parent
6d3ecdea55
commit
7444c11c82
3 changed files with 24 additions and 23 deletions
|
|
@ -289,15 +289,9 @@ BlazeComponent.extendComponent({
|
|||
'click a.fa.fa-copy'(event) {
|
||||
const $editor = this.$('textarea.editor');
|
||||
const promise = Utils.copyTextToClipboard($editor[0].value);
|
||||
if (promise) {
|
||||
promise.then(() => {
|
||||
const $tooltip = this.$('.copied-tooltip');
|
||||
$tooltip.show(100);
|
||||
setTimeout(() => $tooltip.hide(100), 1000);
|
||||
}, (err) => {
|
||||
console.error("error: ", err);
|
||||
});
|
||||
}
|
||||
|
||||
const $tooltip = this.$('.copied-tooltip');
|
||||
Utils.showCopied(promise, $tooltip);
|
||||
},
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue