Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 5adae58

Browse files
committed
added $event and $ui arguments to attr expr
Attribute expression callbacks now also have access to the event and ui arguments. For example you could specify ui-sortable-update="myCallback($event, $ui)".
1 parent 475a21a commit 5adae58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sortable.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -577,14 +577,18 @@ angular
577577
callbacks[key] = combineCallbacks(callbacks[key], function() {
578578
var attrHandler = scope[key];
579579
var attrHandlerFn;
580+
var args = {
581+
$event: arguments[0],
582+
$ui: arguments[1]
583+
};
580584
if (
581585
typeof attrHandler === 'function' &&
582586
(
583587
'uiSortable' +
584588
key.substring(0, 1).toUpperCase() +
585589
key.substring(1)
586590
).length &&
587-
typeof (attrHandlerFn = attrHandler()) === 'function'
591+
typeof (attrHandlerFn = attrHandler(args)) === 'function'
588592
) {
589593
attrHandlerFn.apply(this, arguments);
590594
}

0 commit comments

Comments
 (0)