File tree Expand file tree Collapse file tree
assets/javascripts/admin/plugins
javascript/apps/blocks-editor/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33//= require codemirror/mode/css/css
44//= require codemirror/mode/htmlmixed/htmlmixed
55//= require codemirror/mode/sass/sass
6+ //= require codemirror/addon/display/autorefresh
67
78/*global CodeMirror */
89
Original file line number Diff line number Diff line change @@ -157,7 +157,6 @@ export default {
157157 },
158158
159159 wireCancelButtons (root ) {
160- // The `.vue__changes__cancel` button closes the offcanvas.
161160 root .querySelectorAll (' .vue__editor__actions__cancel' ).forEach ((button ) => {
162161 button .addEventListener (' click' , (event ) => {
163162 event .preventDefault ();
Original file line number Diff line number Diff line change @@ -30,10 +30,12 @@ export default {
3030 },
3131 },
3232 mounted () {
33+ this .$refs .textarea .value = this .modelValue || ' ' ;
34+
3335 const config = window .codemirrorManager .defaultConfig ();
3436 config .mode = ' htmlmixed' ;
37+ config .autoRefresh = true ;
3538 this .editor = window .CodeMirror .fromTextArea (this .$refs .textarea , config);
36- this .editor .setValue (this .modelValue || ' ' );
3739 this .editor .on (' change' , (instance ) => {
3840 this .$emit (' update:modelValue' , instance .getValue ());
3941 });
You can’t perform that action at this time.
0 commit comments