feat: add markdown attributes

This commit is contained in:
Zach Daniel 2022-10-31 17:05:24 -04:00
parent e2bd5f3d5f
commit ce1e0aef20
2 changed files with 5 additions and 28 deletions

View file

@ -77,9 +77,10 @@ Hooks.JsonView = {
}
}
const init = (element, initialValue) => new EasyMDE({
const init = (element) => new EasyMDE({
element: element,
forceSync: true
forceSync: true,
initialValue: element.getAttribute("value")
})
Hooks.MarkdownEditor = {
@ -87,33 +88,9 @@ Hooks.MarkdownEditor = {
const id = this.el.getAttribute("data-target-id")
const el = document.getElementById(id)
init(el)
},
// updated(){
// console.log(this.el.value)
// const textArea = init(this.el, this.el.value);
// // textArea.codemirror.on("change", ( ) => {
// // console.log(textArea.value())
// // // this.pushEventTo(this.el, "")
// // })
// // init(document.getElementById(inputId));
// // textArea.codemirror.on("change", ( ) => {
// // this.pushEventTo(
// // this.el,
// // "handle_clientside_richtext",
// // {richtext_data: textArea.value()}
// // );
// // this.handleEvent(
// // "richtext_event",
// // (richtext_data) => textArea.value(richtext_data)
// // )
// // })
// }
}
}
Hooks.Actor = {
mounted() {
this.handleEvent("set_actor", (payload) => {

File diff suppressed because one or more lines are too long