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 2ad53cf6b5af40f564e919e708da8552b3daa360
parent 0ba9d8eda802c5238553b1b10695262e82291c56
Author: unitehenry <unitehenry@gmail.com>
Date:   Thu, 31 Oct 2019 08:05:33 -0400

validate file refactor

Diffstat:
Msrc/striveneditor.js | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -766,6 +766,7 @@ export default class StrivenEditor { }, false); this.body.ondragenter = e => { + console.log(e) if (!this.body.querySelector('.se-file-drop-dropzone')) { const dropzone = document.createElement("div"); const dropzoneTextEl = document.createElement("p"); @@ -1069,8 +1070,12 @@ export default class StrivenEditor { } validateFile(file) { - const extension = file.type.split('/').pop(); - return this.options.extensions.includes(`.${extension}`); + const extension = (file && file.type.split('/').pop()); + if(extension) { + return this.options.extensions.includes(`.${extension}`); + } else { + return false; + } } attachFile(file) {