Skip to content

Commit a670535

Browse files
authored
Merge pull request #1 from filipkis/fix-46
Fixes SortableJS#46
2 parents f63b6c0 + 520c69f commit a670535

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Diff for: angular-legacy-sortable.js

+2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
watchers = null;
154154
sortable = null;
155155
nextSibling = null;
156+
removed = null;
156157
}
157158

158159

@@ -169,6 +170,7 @@
169170
onEnd: function (/**Event*/evt) {
170171
_emitEvent(evt, removed);
171172
scope.$apply();
173+
removed = null;
172174
},
173175
onAdd: function (/**Event*/evt) {
174176
_sync(evt);

Diff for: e2e/nested-drag-drop.e2e.js

+18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
describe('nested drag and drop', () => {
2+
it('should have correct model after moving between lists', () => {
3+
browser.get('http://localhost:8080/nested.html')
4+
browser.executeScript('$("#item2").simulate("drag-n-drop", { dragTarget: $("#item3"), interpolation: {stepWidth: 2, stepDelay: 30}});')
5+
browser.sleep(1000)
6+
element(by.id('main-list')).evaluate('$ctrl.lastDragged.name').then(function(value){
7+
expect(value).toBe('item2');
8+
})
9+
browser.executeScript('$("#item3").simulate("drag-n-drop", { dragTarget: $("#subitem1"), interpolation: {stepWidth: 2, stepDelay: 30}});')
10+
browser.sleep(1000)
11+
element(by.id('main-list')).evaluate('$ctrl.lastDragged.name').then(function(value){
12+
expect(value).toBe('item3');
13+
})
14+
browser.executeScript('$("#item1").simulate("drag-n-drop", { dragTarget: $("#item2"), interpolation: {stepWidth: 2, stepDelay: 30}});')
15+
browser.sleep(1000)
16+
element(by.id('main-list')).evaluate('$ctrl.lastDragged.name').then(function(value){
17+
expect(value).toBe('item1');
18+
})
19+
})
220

321
it('should allow list with nested list to be dropped in a nested list', () => {
422
browser.get('http://localhost:8080/nested.html')

0 commit comments

Comments
 (0)