Rovak / InlineAttachment

Easily paste and upload files/images in plain textareas
http://git.razko.nl/InlineAttachment
MIT License
618 stars 77 forks source link

Proxied invocation of overridable functions through call to apply `this` context #42

Closed abrom closed 9 years ago

abrom commented 9 years ago

Allows overridden custom upload/error functions to access the inlineattach object for calling back on the onErrorUploading/onUploadedFile functions.

i.e.

$('.inlineattach').inlineattach({
  customUploadHandler: function(file) {
        var that = this;
        MyCustomUploader(function(error, data) {
            if (error) {
                that.onErrorUploading();
            } else {
                that.onUploadedFile(data);
            }   
        });
  }});
Rovak commented 9 years ago

Thanks @abrom for this improvement! I will add these changes to the upcoming version 2 aswell.

abrom commented 9 years ago

No problems @Rovak ! Great plugin you've written :+1: