#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 = {
|
||||
url: String,
|
||||
text: String,
|
||||
title: String
|
||||
title: String,
|
||||
copyContent: String
|
||||
};
|
||||
|
||||
declare readonly urlValue: string;
|
||||
declare readonly textValue: string;
|
||||
declare readonly titleValue: string;
|
||||
declare readonly copyContentValue: string;
|
||||
|
||||
share() {
|
||||
let shareConfiguration = {};
|
||||
|
@ -42,4 +44,8 @@ export default class extends Controller {
|
|||
})
|
||||
.catch(noop);
|
||||
}
|
||||
|
||||
async copyToClipboard(){
|
||||
await navigator.clipboard.writeText(this.copyContentValue)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue