From 3e9c122568dd203a0b0ee8cd7f83f1287906c03e Mon Sep 17 00:00:00 2001 From: vtyeh Date: Mon, 28 Oct 2024 11:47:46 -0700 Subject: [PATCH] Remove ProseMirror transaction logic because it is unnecessary --- templates/classic.tmpl | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) 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();