diff --git a/templates/classic.tmpl b/templates/classic.tmpl index b3029f1..0c411b4 100644 --- a/templates/classic.tmpl +++ b/templates/classic.tmpl @@ -348,19 +348,10 @@ } catch (e) {} }; var fonts = document.querySelectorAll('nav#font-picker a.font'); - var setFontClass = function(fontClass) { - return (state, dispatch) => { - if (dispatch && window.editorView) { - window.editorView.view.dom.classList.remove("norm", "sans", "wrap"); - window.editorView.view.dom.classList.add(fontClass); - } - return true; - } - } - var changeEditorFont = function(fontClass) { + var setEditorFontClass = function(fontClass) { if (window.editorView) { - const command = setFontClass(fontClass); - command(window.editorView.view.state, window.editorView.view.dispatch); + window.editorView.view.dom.classList.remove("norm", "sans", "wrap"); + window.editorView.view.dom.classList.add(fontClass); } }; for (var i=0; i {changeEditorFont(selectedFont)}); + document.addEventListener('DOMContentLoaded', () => {setEditorFontClass(selectedFont)}); var sfe = document.querySelector('nav#font-picker a.font.'+selectedFont); if (sfe != null) { sfe.click();