angular-ui / ui-sortable

jQuery UI Sortable for AngularJS
http://angular-ui.github.io/ui-sortable/
MIT License
1.26k stars 444 forks source link

Adding ui and event arguments to attribute callback expressions #558

Open filipkis opened 5 years ago

filipkis commented 5 years ago

Currently if you specify an expression that's not just a reference to a function such as ui-sortable-update=doSomething() you have no way of accessing the event and ui arguments passed to callbacks.

With this PR I've made those two arguments available as $event and $ui parameters in the scope of the expression execution. So now you could do ui-sortable-update=doSomething($event, $ui) or even ui-sortable-update=doSomething($event, $ui.item.sortable).

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 5adae58cd837033e59558ca1eb501d283ce3852a on filipkis:attribute-arguments into e763b5765eea87743c8463ddf045a53015193c20 on angular-ui:master.

filipkis commented 5 years ago

P.S. I've originally tried to submit this PR as #557, but had trouble with jshint (there's a post commit hook that messes up the quotes), that's why I created a new one to have a cleaner history.

filipkis commented 5 years ago

Any chance this gets merged into main branch. It's rather simple, but IMHO valuable addition, so it shouldn't be hard to review.