From 41bf7cc52faff91efa9303e29fae631f5c1a1476 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sun, 18 Mar 2018 03:01:10 +0100 Subject: Fix typo in vedor extension Signed-off-by: Sheogorath --- public/vendor/inlineAttachment/inline-attachment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/vendor/inlineAttachment/inline-attachment.js b/public/vendor/inlineAttachment/inline-attachment.js index d9503d62..e927c428 100644 --- a/public/vendor/inlineAttachment/inline-attachment.js +++ b/public/vendor/inlineAttachment/inline-attachment.js @@ -131,7 +131,7 @@ * Extension which will be used when a file extension could not * be detected */ - defualtExtension: 'png', + defaultExtension: 'png', /** * JSON field which refers to the uploaded file URL @@ -220,7 +220,7 @@ xhr = new XMLHttpRequest(), id = id, settings = this.settings, - extension = settings.defualtExtension; + extension = settings.defaultExtension; if (typeof settings.setupFormData === 'function') { settings.setupFormData(formData, file); -- cgit v1.2.3 From 621996289212694f37c7e6513d215818940d2b6b Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sun, 18 Mar 2018 03:06:11 +0100 Subject: Reorganize usage of `getAsFile()` Signed-off-by: Sheogorath --- public/vendor/inlineAttachment/inline-attachment.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/vendor/inlineAttachment/inline-attachment.js b/public/vendor/inlineAttachment/inline-attachment.js index e927c428..5c7c7166 100644 --- a/public/vendor/inlineAttachment/inline-attachment.js +++ b/public/vendor/inlineAttachment/inline-attachment.js @@ -370,8 +370,11 @@ if (this.isFileAllowed(item)) { result = true; var id = ID(); - this.onFileInserted(item.getAsFile(), id); - this.uploadFile(item.getAsFile(), id); + var file = item.getAsFile(); + if (file !== null) { + this.onFileInserted(file, id); + this.uploadFile(file, id); + } } } } -- cgit v1.2.3