mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-03 21:54:22 +01:00
Update copy to clipboard buttons to be standardized
This commit is contained in:
1 parent
c3c846f82d
commit
598a93d224
8 files changed
+33
-53
No files matched your search
@@ -128,12 +128,11 @@ Vue.prototype.$sanitizeSlug = (str) => {
|
||||
return str
|
||||
}
|
||||
|
||||
Vue.prototype.$copyToClipboard = (str, ctx) => {
|
||||
Vue.prototype.$copyToClipboard = (str) => {
|
||||
return new Promise((resolve) => {
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(str).then(
|
||||
() => {
|
||||
if (ctx) ctx.$toast.success('Copied to clipboard')
|
||||
resolve(true)
|
||||
},
|
||||
(err) => {
|
||||
@@ -152,7 +151,6 @@ Vue.prototype.$copyToClipboard = (str, ctx) => {
|
||||
document.execCommand('copy')
|
||||
document.body.removeChild(el)
|
||||
|
||||
if (ctx) ctx.$toast.success('Copied to clipboard')
|
||||
resolve(true)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user