Skip to content

Commit

Permalink
Merge pull request #53 from Piees/master
Browse files Browse the repository at this point in the history
Bind remove function
  • Loading branch information
michaelmalonenz authored Mar 2, 2019
2 parents c5cfd38 + 5f19108 commit 5670174
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dragula-and-drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {Dragula} from './dragula';
@bindable({ name: 'overFn', attribute: 'over-fn', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'outFn', attribute: 'out-fn', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'shadowFn', attribute: 'shadow-fn', defaultBindingMode: bindingMode.oneTime })
@bindable({ name: 'removeFn', attribute: 'remove-fn', defaultBindingMode: bindingMode.oneTime })
@customElement('dragula-and-drop')
@useView('./dragula-and-drop.html')
@inject(GLOBAL_OPTIONS)
Expand Down Expand Up @@ -81,6 +82,11 @@ export class DragulaAndDrop {
if (typeof this.shadowFn === 'function')
this.shadowFn({ item, target, source, itemVM });
});

this.dragula.on('remove', (item, target, source, itemVM) => {
if (typeof this.removeFn === 'function')
this.removeFn({ item, target, source, itemVM });
});
}

unbind() {
Expand Down

0 comments on commit 5670174

Please sign in to comment.