Skip to content

Commit

Permalink
Fix: drag not working if onDrop undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
paronne committed Jul 7, 2021
1 parent 2c6e520 commit 510e5e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion customrenderedcomponents/customlist/customlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ angular.module('customrenderedcomponentsCustomlist',['servoy'])
pull: $scope.model.dragEnabled, // can drag into other lists
put: $scope.model.dropEnabled, // can drop from other lists
};

// copy data upon drag
if ($scope.model.dragEnabled) {
opts.setData = setData;
}

// group name
if ($scope.model.dragEnabled || $scope.model.dropEnabled) {
Expand Down Expand Up @@ -228,7 +233,6 @@ angular.module('customrenderedcomponentsCustomlist',['servoy'])
// opts.onChoose = onChoose;

if ($scope.handlers.onDrop) {
opts.setData = setData;
opts.onAdd = onAdd;
opts.onRemove = onRemove;
}
Expand Down
6 changes: 5 additions & 1 deletion customrenderedcomponents/foundsetlist/foundsetlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ angular.module('customrenderedcomponentsFoundsetlist', ['servoy'])
pull: $scope.model.dragEnabled, // can drag into other lists
put: $scope.model.dropEnabled, // can drop from other lists
};

// copy data upon drag
if ($scope.model.dragEnabled) {
opts.setData = setData;
}

// group name
if ($scope.model.dragEnabled || $scope.model.dropEnabled) {
Expand All @@ -363,7 +368,6 @@ angular.module('customrenderedcomponentsFoundsetlist', ['servoy'])

/** Events */
if ($scope.handlers.onDrop) {
opts.setData = setData;
opts.onAdd = onAdd;
}

Expand Down

0 comments on commit 510e5e8

Please sign in to comment.