Init project
This commit is contained in:
15
assets/controllers/ckeditor5_controller.js
Normal file
15
assets/controllers/ckeditor5_controller.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// assets/controllers/ckeditor5_controller.js
|
||||
import { Controller } from "@hotwired/stimulus";
|
||||
import EnhancedEditor from "../js/ckeditor-init.js";
|
||||
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
this.editor = EnhancedEditor.create(this.element)
|
||||
.then(editor => (this.editor = editor))
|
||||
.catch(error => console.error(error));
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.editor.destroy().catch(error => console.error(error));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user