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 6a7f1df8e372777a4c186cb10bff05de9d7616f9
parent 5bd368a4b0c91bb89ae21a243d2a67fd5cc1274c
Author: unitehenry <unitehenry@gmail.com>
Date:   Tue, 26 Nov 2019 08:27:35 -0500

safari chrome insertUnorderedList fix

Diffstat:
Mdemo/src/App.vue | 17++++++++++++++++-
Msrc/striveneditor.js | 5+++--
2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/demo/src/App.vue b/demo/src/App.vue @@ -15,7 +15,13 @@ :meta-url="metaUrl" :on-enter="submitOnEnter" ></striven-editor> - <div v-html="content"></div> + + <!-- TESTING --> + <!-- <button @click="safariOut">isSafari</button> --> + <!-- <button @click="chromeOut">isChrome</button> --> + <!-- <button @click="insertList">insertUnorderedList</button> --> + + <!-- <div v-html="content"></div> --> <!-- <div ref="customButton" style="display: flex; align-items: flex-end;"> --> <!-- <div class="custom-button" @click="sendContent">Send</div> --> <!-- </div> --> @@ -77,6 +83,15 @@ export default { sendContent() { console.log(this.editor.getContent()); this.editor.clearContent(); + }, + safariOut() { + this.editor.setContent(`${this.editor.browser.isSafari()}`) + }, + chromeOut() { + this.editor.setContent(`${this.editor.browser.isChrome()}`) + }, + insertList() { + document.execCommand('insertUnorderedList'); } } }; diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -202,6 +202,7 @@ export default class StrivenEditor { } break; default: + this.body.focus(); this.executeCommand(command); break; } @@ -1407,7 +1408,7 @@ export default class StrivenEditor { document.execCommand(command); } else { - document.execCommand(command, true); + document.execCommand(command); } break; case "insertUnorderedList": @@ -1415,7 +1416,7 @@ export default class StrivenEditor { document.execCommand(command); } else { - document.execCommand(command, true); + document.execCommand(command); } break; case "attachment":