From e88f72f6ce7753101d78fdc95e8d8c2abe4e7dea Mon Sep 17 00:00:00 2001 From: Guillaume Cusnieux Date: Tue, 18 Sep 2018 09:16:55 +0200 Subject: [PATCH] refactor: format code --- src/plugin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugin.js b/src/plugin.js index 14e3e0c..3d64f4c 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -101,6 +101,7 @@ const stopPropagating = event => { const plugin = (editor) => { let lastAMnode, copyMode, toggleMathButton, subscript, superscript, disableSubSup, runMathJax; + editor.addCommand('toggleMathJax', () => { copyMode = !copyMode; toggleMathButton.active(copyMode); @@ -112,6 +113,7 @@ const plugin = (editor) => { } }); }); + editor.addCommand('runMathJax', element => { const MathJax = editor.contentWindow.MathJax; if (typeof element !== 'string' && !editor.getBody().contains(element)) { @@ -120,6 +122,7 @@ const plugin = (editor) => { runMathJax = true; MathJax.Hub.Queue(["Typeset", MathJax.Hub, element]); }); + editor.addCommand('removeMathJax', () => { const MathJax = editor.contentWindow.MathJax; if (!MathJax) { @@ -137,6 +140,7 @@ const plugin = (editor) => { editor.dom.remove(hidden ? hidden.parentNode : ''); editor.dom.remove(fonts ? fonts.parentNode : ''); }); + const removeMathJax = () => { const MathJax = editor.contentWindow.MathJax; if (!MathJax) {