Closed drewlsvern closed 6 years ago
You need to customize the plugin, right now there is no option.
I add a confirm alert before deletecallback near line 248
ORIGINAL CODE: if(s.showDelete) { pd.del.show(); pd.del.click(function () { pd.statusbar.hide().remove(); var arr = [filename]; if(s.deleteCallback) s.deleteCallback.call(this, arr, pd); obj.selectedFiles -= 1; updateFileCounter(s, obj); }); }
MODIFIED CODE
if(s.showDelete)
{
pd.del.show();
pd.del.click(function () {
var conferma=confirm("Confirm?");
if (conferma== true){
pd.statusbar.hide().remove();
var arr = [filename];
if(s.deleteCallback) s.deleteCallback.call(this, arr, pd);
obj.selectedFiles -= 1;
updateFileCounter(s, obj);
}
});
}
I am trying to implement a custom confirmation upon deleteCallback. It seems as though the deleteCallback automatically removes the .ajax-file-upload-statusbar div from the DOM even if you don't end up making an ajax, or even if it is not successful.
Is there a way to return false (or something else) within the callback function?
Please advise.