Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed issue #16194: file upload disables other clicks.
After loading the upload frame inside the modal, 'relevance:on' event handlers are lost.
Calling triggerEmRelevance() when closing the modal fixes the issue.

Removes the cache for the currentUploadHandler. This wasn't working for multiple upload question in the same as it was caching it on a window level variable. Removed the cache for simplifiying.

Contains also fix for #16549: Error message is shown while trying to delete and reupload file using File upload
  • Loading branch information
gabrieljenik committed Aug 18, 2020
1 parent be5f29f commit e322906
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
17 changes: 8 additions & 9 deletions assets/packages/questions/upload/build/uploadquestion.js
Expand Up @@ -703,6 +703,7 @@
toDeleteFlag = true; // Fix IE mixed content issue

iframe.src = "javascript:'<html></html>';";
removeNode(iframe);
});
},

Expand All @@ -726,7 +727,10 @@
} // sending request


var iframe = this._createIframe();
var iframe = this._createIframe(); // Get response from iframe and fire onComplete event when ready


this._getResponse(iframe, file);

var form = this._createForm(iframe); // assuming following structure
// div -> input type='file'
Expand All @@ -741,10 +745,7 @@
removeNode(form);
form = null;
removeNode(this._input);
this._input = null; // Get response from iframe and fire onComplete event when ready

this._getResponse(iframe, file); // get ready for next request

this._input = null; // get ready for next request

this._createInput();
}
Expand Down Expand Up @@ -787,6 +788,7 @@
var uploadFrame = $('#uploader' + _this.fieldname);
window.currentUploadHandler.saveAndExit(_this.fieldname, _this.show_title, _this.show_comment, 1);
uploadFrame.html('');
triggerEmRelevance();
return true;
});
this.$el.off('click.lsuploadquestion');
Expand Down Expand Up @@ -1230,10 +1232,7 @@
}

window.getUploadHandler = function (qid, options) {
if (!window.currentUploadHandler) {
window.currentUploadHandler = new uploadHandler(qid, options);
}

window.currentUploadHandler = new uploadHandler(qid, options);
window.currentUploadHandler.init();
return window.currentUploadHandler;
};
Expand Down

0 comments on commit e322906

Please sign in to comment.