Skip to content

Commit

Permalink
Made dropZone null by default for fileupload() calls to fix erroneous…
Browse files Browse the repository at this point in the history
… API calls
  • Loading branch information
jack-brinkman committed Nov 23, 2023
1 parent 36c75f7 commit e63afc1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions grails-app/assets/javascripts/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ function attachViewModelToFileUpload(uploadUrl, documentViewModel, uiSelector, p
$(uiSelector).fileupload({
url:uploadUrl,
pasteZone: null,
dropZone: null,
formData:function(form) {
return [{name:'document', value:documentViewModel.toJSONString()}]
},
Expand Down
7 changes: 4 additions & 3 deletions grails-app/assets/javascripts/knockout-custom-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ ko.bindingHandlers.stagedImageUpload = {
$(element).fileupload({
url: config.url,
pasteZone: null,
dropZone: null,
autoUpload: true
}).on('fileuploadadd', function (e, data) {
complete(false);
Expand Down Expand Up @@ -703,11 +704,11 @@ ko.bindingHandlers.fileUploadNoImage = {

var defaults = {autoUpload: true};
var settings = {
pasteZone: null
pasteZone: null,
dropZone: null
};
$.extend(settings, defaults, options());
$(element).fileupload(settings
).on('fileuploadadd', function (e, data) {
$(element).fileupload(settings).on('fileuploadadd', function (e, data) {
window.incrementAsyncCounter && window.incrementAsyncCounter();
}).on('fileuploaddone', function (e, data) {
window.decreaseAsyncCounter && window.decreaseAsyncCounter();
Expand Down
2 changes: 2 additions & 0 deletions grails-app/assets/javascripts/outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ ko.bindingHandlers.photoPointUpload = {
$(element).fileupload({
url:config.url,
pasteZone: null,
dropZone: null,
autoUpload:true
}).on('fileuploadadd', function(e, data) {
complete(false);
Expand Down Expand Up @@ -360,6 +361,7 @@ ko.bindingHandlers.fileUploadWithProgress = {
$(element).fileupload({
url: config.url,
pasteZone: null,
dropZone: null,
autoUpload: true
}).on('fileuploadadd', function (e, data) {
complete(false);
Expand Down

0 comments on commit e63afc1

Please sign in to comment.