From 0fc64ff7f92cc39a166cd92374cc307ade52ffb3 Mon Sep 17 00:00:00 2001 From: Joshua License Date: Sat, 8 Aug 2020 11:05:56 +0100 Subject: [PATCH] Pass the MDE context to the image function Removes the need to bind the context manually when wanting to access the class methods. --- src/js/easymde.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/easymde.js b/src/js/easymde.js index bfa1a7b..c2cae67 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -2287,7 +2287,7 @@ EasyMDE.prototype.uploadImageUsingCustomFunction = function(imageUploadFunction, .replace('#image_max_size#', humanFileSize(self.options.imageMaxSize, units)); } - imageUploadFunction(file, onSuccess, onError); + imageUploadFunction.apply(this, [file, onSuccess, onError]); }; EasyMDE.prototype.setPreviewMaxHeight = function () {