Files
arts-ticule/assets/controllers/ckeditor5_controller.js
2026-01-11 16:19:42 +01:00

15 lines
469 B
JavaScript

// 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));
}
}