mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +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
|
|
@ -506,6 +506,21 @@ Utils = {
|
|||
}
|
||||
return ret;
|
||||
},
|
||||
|
||||
/** show the "copied!" message
|
||||
* @param promise the promise of Utils.copyTextToClipboard
|
||||
* @param $tooltip jQuery tooltip element
|
||||
*/
|
||||
showCopied(promise, $tooltip) {
|
||||
if (promise) {
|
||||
promise.then(() => {
|
||||
$tooltip.show(100);
|
||||
setTimeout(() => $tooltip.hide(100), 1000);
|
||||
}, (err) => {
|
||||
console.error("error: ", err);
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// A simple tracker dependency that we invalidate every time the window is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue