Browse Source

Merge branch 'dev' into gh-pages

gh-pages
RubaXa 10 years ago
parent
commit
01a6a55ce2
  1. 6
      Sortable.js
  2. 5
      ng-sortable.js

6
Sortable.js

@ -469,7 +469,7 @@
!options.dragoverBubble && evt.stopPropagation(); !options.dragoverBubble && evt.stopPropagation();
} }
if (!_silent && activeGroup && if (!_silent && activeGroup && !options.disabled &&
(isOwner (isOwner
? canSort || (revert = !rootEl.contains(dragEl)) ? canSort || (revert = !rootEl.contains(dragEl))
: activeGroup.pull && groupPut && ( : activeGroup.pull && groupPut && (
@ -949,9 +949,11 @@
*/ */
function _index(/**HTMLElement*/el) { function _index(/**HTMLElement*/el) {
var index = 0; var index = 0;
while (el && (el = el.previousElementSibling) && (el.nodeName.toUpperCase() !== 'TEMPLATE')) { while (el && (el = el.previousElementSibling)) {
if (el.nodeName.toUpperCase() !== 'TEMPLATE') {
index++; index++;
} }
}
return index; return index;
} }

5
ng-sortable.js

@ -15,7 +15,7 @@
'use strict'; 'use strict';
angular.module('ng-sortable', []) angular.module('ng-sortable', [])
.constant('$version', '0.3.4') .constant('$version', '0.3.5')
.directive('ngSortable', ['$parse', function ($parse) { .directive('ngSortable', ['$parse', function ($parse) {
var removed, var removed,
nextSibling; nextSibling;
@ -101,13 +101,16 @@
onStart: function (/**Event*/evt) { onStart: function (/**Event*/evt) {
nextSibling = evt.item.nextSibling; nextSibling = evt.item.nextSibling;
options.onStart(source.items()); options.onStart(source.items());
scope.$apply();
}, },
onEnd: function () { onEnd: function () {
options.onEnd(source.items()); options.onEnd(source.items());
scope.$apply();
}, },
onAdd: function (/**Event*/evt) { onAdd: function (/**Event*/evt) {
_sync(evt); _sync(evt);
options.onAdd(source.items(), removed); options.onAdd(source.items(), removed);
scope.$apply();
}, },
onUpdate: function (/**Event*/evt) { onUpdate: function (/**Event*/evt) {
_sync(evt); _sync(evt);

Loading…
Cancel
Save