Skip to content

Commit

Permalink
#62 File Drop on a table row no more working
Browse files Browse the repository at this point in the history
supply the correct event parameter when calling
additionalDropProperties().

307416
  • Loading branch information
cyrill-wyss authored and cguglielmo committed Dec 6, 2021
1 parent 68d2e2f commit 8624163
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Expand Up @@ -38,7 +38,7 @@ scout.FormFieldAdapter.prototype._goOnline = function() {

scout.FormFieldAdapter.prototype._onWidgetEvent = function(event) {
if (event.type === 'drop' && this.widget.dragAndDropHandler) {
this.widget.dragAndDropHandler.uploadFiles(event.files);
this.widget.dragAndDropHandler.uploadFiles(event);
} else {
scout.FormFieldAdapter.parent.prototype._onWidgetEvent.call(this, event);
}
Expand Down
Expand Up @@ -359,7 +359,7 @@ scout.TableAdapter.prototype._onWidgetEvent = function(event) {
} else if (event.type === 'aggregationFunctionChanged') {
this._onWidgetAggregationFunctionChanged(event);
} else if (event.type === 'drop' && this.widget.dragAndDropHandler) {
this.widget.dragAndDropHandler.uploadFiles(event.files);
this.widget.dragAndDropHandler.uploadFiles(event);
} else {
scout.TableAdapter.parent.prototype._onWidgetEvent.call(this, event);
}
Expand Down
Expand Up @@ -85,7 +85,7 @@ scout.TreeAdapter.prototype._onWidgetEvent = function(event) {
} else if (event.type === 'nodesChecked') {
this._onWidgetNodesChecked(event);
} else if (event.type === 'drop' && this.widget.dragAndDropHandler) {
this.widget.dragAndDropHandler.uploadFiles(event.files);
this.widget.dragAndDropHandler.uploadFiles(event);
} else {
scout.TreeAdapter.parent.prototype._onWidgetEvent.call(this, event);
}
Expand Down
Expand Up @@ -115,10 +115,10 @@ scout.DragAndDropHandler.prototype._validationFailed = function(files, error) {
.buildAndOpen();
};

scout.DragAndDropHandler.prototype.uploadFiles = function(files) {
if (files.length >= 1) {
this.target.session.uploadFiles(this.target, files,
this.additionalDropProperties ? this.additionalDropProperties(event) : undefined,
scout.DragAndDropHandler.prototype.uploadFiles = function(event) {
if (event && event.originalEvent && event.files.length >= 1) {
this.target.session.uploadFiles(this.target, event.files,
this.additionalDropProperties ? this.additionalDropProperties(event.originalEvent) : undefined,
this.dropMaximumSize ? this.dropMaximumSize() : undefined,
this.allowedTypes ? this.allowedTypes() : undefined);
}
Expand Down

0 comments on commit 8624163

Please sign in to comment.