Browse Source

Merge branch 'dev' into gh-pages

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

8
Sortable.js

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

5
ng-sortable.js

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

Loading…
Cancel
Save