Skip to content

Commit

Permalink
refactor: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Cusnieux committed Sep 18, 2018
1 parent eb3f9f6 commit e88f72f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -112,6 +113,7 @@ const plugin = (editor) => {
}
});
});

editor.addCommand('runMathJax', element => {
const MathJax = editor.contentWindow.MathJax;
if (typeof element !== 'string' && !editor.getBody().contains(element)) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit e88f72f

Please sign in to comment.