From 12df12c2b57c48831a728100a4bab5bda26ec896 Mon Sep 17 00:00:00 2001 From: RubaXa Date: Mon, 13 Apr 2015 22:52:02 +0300 Subject: [PATCH] * correct ng-events --- ng-sortable.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ng-sortable.js b/ng-sortable.js index a34c756..d340a59 100644 --- a/ng-sortable.js +++ b/ng-sortable.js @@ -25,7 +25,7 @@ angular.module('ng-sortable', []) - .constant('version', '0.3.6') + .constant('version', '0.3.7') .directive('ngSortable', ['$parse', function ($parse) { var removed, nextSibling; @@ -78,7 +78,7 @@ /* jshint expr:true */ options[name] && options[name]({ - model: item, + model: item || source && source.item(evt.item), models: source && source.items(), oldIndex: evt.oldIndex, newIndex: evt.newIndex @@ -143,13 +143,13 @@ }, onUpdate: function (/**Event*/evt) { _sync(evt); - _emitEvent(evt, source && source.item(evt.item)); + _emitEvent(evt); }, onRemove: function (/**Event*/evt) { _emitEvent(evt, removed); }, onSort: function (/**Event*/evt) { - _emitEvent(evt, source && source.item(evt.item)); + _emitEvent(evt); } }));