1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-02 16:38:38 +00:00

Extract Clipboard controller

This commit is contained in:
Yassine Guedidi 2025-03-02 14:37:38 +01:00
parent ffeca7f94d
commit 9da9e6b004
4 changed files with 20 additions and 11 deletions

View file

@ -0,0 +1,16 @@
import { Controller } from '@hotwired/stimulus';
import ClipboardJS from 'clipboard';
export default class extends Controller {
connect() {
this.clipboard = new ClipboardJS(this.element);
this.clipboard.on('success', (e) => {
e.clearSelection();
});
}
disconnect() {
this.clipboard.destroy();
}
}