From 5adae58cd837033e59558ca1eb501d283ce3852a Mon Sep 17 00:00:00 2001 From: Filip Kis Date: Wed, 24 Oct 2018 16:17:50 +0200 Subject: [PATCH] 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)". --- src/sortable.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sortable.js b/src/sortable.js index ed0c482..eaceed5 100644 --- a/src/sortable.js +++ b/src/sortable.js @@ -577,6 +577,10 @@ angular callbacks[key] = combineCallbacks(callbacks[key], function() { var attrHandler = scope[key]; var attrHandlerFn; + var args = { + $event: arguments[0], + $ui: arguments[1] + }; if ( typeof attrHandler === 'function' && ( @@ -584,7 +588,7 @@ angular key.substring(0, 1).toUpperCase() + key.substring(1) ).length && - typeof (attrHandlerFn = attrHandler()) === 'function' + typeof (attrHandlerFn = attrHandler(args)) === 'function' ) { attrHandlerFn.apply(this, arguments); }