#1448, add copyToClipboard controller action
This commit is contained in:
parent
93d67a8307
commit
e7f2582f59
|
@ -5,12 +5,14 @@ export default class extends Controller {
|
||||||
static values = {
|
static values = {
|
||||||
url: String,
|
url: String,
|
||||||
text: String,
|
text: String,
|
||||||
title: String
|
title: String,
|
||||||
|
copyContent: String
|
||||||
};
|
};
|
||||||
|
|
||||||
declare readonly urlValue: string;
|
declare readonly urlValue: string;
|
||||||
declare readonly textValue: string;
|
declare readonly textValue: string;
|
||||||
declare readonly titleValue: string;
|
declare readonly titleValue: string;
|
||||||
|
declare readonly copyContentValue: string;
|
||||||
|
|
||||||
share() {
|
share() {
|
||||||
let shareConfiguration = {};
|
let shareConfiguration = {};
|
||||||
|
@ -42,4 +44,8 @@ export default class extends Controller {
|
||||||
})
|
})
|
||||||
.catch(noop);
|
.catch(noop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async copyToClipboard(){
|
||||||
|
await navigator.clipboard.writeText(this.copyContentValue)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue