Skip to content

Commit

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

Removed the jquery package as it was overstepping all the bindings previously done.

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 dd0e367 commit e515553
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion application/controllers/UploaderController.php
Expand Up @@ -282,7 +282,7 @@ public function run($actionID)
}
/* No action */
$meta = '';
App()->getClientScript()->registerPackage('jquery');
//App()->getClientScript()->registerPackage('jquery');
App()->getClientScript()->registerPackage('question-file-upload');

$aSurveyInfo = getSurveyInfo($surveyid, $sLanguage);
Expand Down
16 changes: 7 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 @@ -1230,10 +1231,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 e515553

Please sign in to comment.