fxmontigny / quill-image-upload

A module for Quill rich text editor to upload images to be selected from toolbar editor.
107 stars 43 forks source link

Enhancement: Ability to show progress/loader #2

Closed royshouvik closed 6 years ago

royshouvik commented 6 years ago

Thanks for getting this up. Worked out of the box like a charm!

Since uploading to server takes some amount of time, it would be nice to show some feedback to the user.

fxmontigny commented 6 years ago

Hi,

you cannont show progressive loader but only when the loading start and finish.

checkBeforeSend: (file, next) => {
     // show loader
    next(file); // go back to component and send to the server
}

callbackOK: (serverResponse, next) => {
     // hide loader
    next(serverResponse);   
},

callbackKO: (serverError) => {
    // hide loader
    alert(serverError);
},
royshouvik commented 6 years ago

I ended up doing something like that just after posting this question. Thanks 👍