bugfix, when you cancelled the file dialog and opened it again, files were uploaded twice

This commit is contained in:
Hannes Mannerheim 2015-11-16 21:46:09 +01:00
parent b57857b1bb
commit 560b71d93b

View File

@ -3484,6 +3484,7 @@ $('body').on('click','.upload-image',function () {
var thisUploadButton = $(this); var thisUploadButton = $(this);
$('#upload-image-input').one('click',function(){ // trick to make the change event only fire once when selecting a file $('#upload-image-input').one('click',function(){ // trick to make the change event only fire once when selecting a file
$(this).unbind('change');
$(this).one('change',function(e){ $(this).one('change',function(e){
uploadAttachment(e, thisUploadButton); uploadAttachment(e, thisUploadButton);
}) })