Skip to content

Commit

Permalink
Merge pull request #772 from SISheogorath/fix/chromeFileError
Browse files Browse the repository at this point in the history
Some fixes for inline-Attachments in Codemirror
  • Loading branch information
SISheogorath authored Mar 21, 2018
2 parents 6485f96 + 6219962 commit fa4a841
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions public/vendor/inlineAttachment/inline-attachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
}
}
Expand Down

0 comments on commit fa4a841

Please sign in to comment.