SortableJS: fix GroupOptions.pull and GroupOptions.put types (#43363)

* fix GroupOptions.pull and GroupOptions.put types

* add params to tests

Co-authored-by: Daniel Greuel <daniel.greuel@msidata.com>
This commit is contained in:
Dan Greuel 2020-03-27 10:49:23 -05:00 committed by GitHub
parent 9bc40339dd
commit 8c6769fb4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -182,11 +182,11 @@ declare namespace Sortable {
/**
* ability to move from the list. clone copy the item, rather than move.
*/
pull?: PullResult | ((to: Sortable, from: Sortable) => PullResult);
pull?: PullResult | ((to: Sortable, from: Sortable, dragEl: HTMLElement, event: SortableEvent) => PullResult);
/**
* whether elements can be added from other lists, or an array of group names from which elements can be taken.
*/
put?: PutResult | ((to: Sortable) => PullResult);
put?: PutResult | ((to: Sortable, from: Sortable, dragEl: HTMLElement, event: SortableEvent) => PutResult);
/**
* a canonical version of pull, created by Sortable
*/

View File

@ -325,7 +325,7 @@ Sortable.create(simpleList, {
group: {
name: 'bar',
put: ['qux'],
pull: function (to, from) {
pull: function (to, from, dragEl, event) {
return from.el.children.length > 2 || 'clone';
}
},
@ -335,7 +335,7 @@ Sortable.create(simpleList, {
Sortable.create(simpleList, {
group: {
name: 'qux',
put: function (to) {
put: function (to, from, dragEl, event) {
return to.el.children.length < 4;
}
},