striven-editor

Maintained and contributed to an open source WYSIWYG editor as an internship project that made it to production and was adopted by the company I was working at.
git clone https://unitehenry.com/git/striven-editor.git
Log | Files | Refs | README | LICENSE

commit 5bd368a4b0c91bb89ae21a243d2a67fd5cc1274c
parent c6c9e6144ad4ffd5ee21981cb92adcca59a0e889
Author: unitehenry <unitehenry@gmail.com>
Date:   Tue, 26 Nov 2019 07:49:57 -0500

executeCommand refactor

Diffstat:
Msrc/striveneditor.js | 13+++----------
1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -405,7 +405,7 @@ export default class StrivenEditor { e.clipboardData.files[0].type.includes("image") ) { - // + // firefox handles its own pasting !this.browser.isFirefox() && e.preventDefault(); convertImage(e.clipboardData.files[0]).then(res => { @@ -1403,10 +1403,7 @@ export default class StrivenEditor { executeCommand(command) { switch (command) { case "insertOrderedList": - if (this.browser.isFirefox()) { - document.execCommand(command); - } - else if (this.browser.isEdge()) { + if (this.browser.isFirefox() || this.browser.isEdge()) { document.execCommand(command); } else { @@ -1414,11 +1411,7 @@ export default class StrivenEditor { } break; case "insertUnorderedList": - if (this.browser.isFirefox()) { - document.execCommand(command); - - } - else if (this.browser.isEdge()) { + if (this.browser.isFirefox() || this.browser.isEdge()) { document.execCommand(command); } else {