diff --git a/README.md b/README.md index 8e1b683..8589cce 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,12 @@ The API is declarative. There are four directives (hooked on attributes) that ne
  • `$helper` is the jqLite/jQuery object of an element that is being dragged around
  • -
  • `sv-on-stop` - The expression passed as a value of that attribute will be evaluated when a user stops moving an element (drops it). This will be called regardless of the fact whether elements have been reordered or now. Several parameters can be injected there like: `sv-on-stop="baz($item, $part, $index)"` where: +
  • `sv-on-stop` - The expression passed as a value of that attribute will be evaluated when a user stops moving an element (drops it). This will be called regardless of the fact whether elements have been reordered or now. Several parameters can be injected there like: `sv-on-stop="baz($item, $part, $index, $moved)"` where:
  • * `sv-part` - this attribute should be placed on an element that is a container for the `ngRepeat`'ed elements. Its value should be the same as the right hand side expression in `ng-repeat` attribute. diff --git a/src/angular-sortable-view.js b/src/angular-sortable-view.js index 05694f0..cacfe55 100644 --- a/src/angular-sortable-view.js +++ b/src/angular-sortable-view.js @@ -252,7 +252,8 @@ onStop($scope, { $part: originatingPart.model(originatingPart.scope), $index: index, - $item: originatingPart.model(originatingPart.scope)[index] + $item: originatingPart.model(originatingPart.scope)[index], + $moved: !!$target }); if($target){ @@ -622,4 +623,4 @@ }; } -})(window, window.angular); \ No newline at end of file +})(window, window.angular);