luwes / craft-codemirror

Add the awesome in-browser code editor CodeMirror as a field type.
MIT License
18 stars 10 forks source link

JavaScript needs to re-init when switching tabs (like under a global set). #7

Closed 23d1 closed 5 years ago

23d1 commented 6 years ago

As title. Doesn't layout properly, so it needs to init again to capture the input field and apply JS.

richhayler commented 5 years ago

Give this a go, it worked for me....

edit your CodeMirror config file to include the following add-on and autoRefresh setting.

return [ "jsOptions" => [ "autoRefresh" => true, ], "addons" => [ "display/autorefresh", ] ];

luwes commented 5 years ago

Duplicate of #10