Skip to content
This repository was archived by the owner on Jun 18, 2018. It is now read-only.

Commit 7476d36

Browse files
committed
Move methods around
1 parent a0bfef0 commit 7476d36

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

src/HTML5Backend.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,19 @@ export default class HTML5Backend {
4343
throw new Error('Cannot have two HTML5 backends at the same time.');
4444
}
4545
this.constructor.isSetUp = true;
46-
4746
this.addEventListeners(window);
4847
}
4948

49+
teardown() {
50+
if (typeof window === 'undefined') {
51+
return;
52+
}
53+
54+
this.constructor.isSetUp = false;
55+
this.removeEventListeners(window);
56+
this.clearCurrentDragSourceNode();
57+
}
58+
5059
addEventListeners(target) {
5160
target.addEventListener('dragstart', this.handleTopDragStart);
5261
target.addEventListener('dragstart', this.handleTopDragStartCapture, true);
@@ -60,18 +69,6 @@ export default class HTML5Backend {
6069
target.addEventListener('drop', this.handleTopDropCapture, true);
6170
}
6271

63-
teardown() {
64-
if (typeof window === 'undefined') {
65-
return;
66-
}
67-
68-
this.constructor.isSetUp = false;
69-
70-
this.removeEventListeners(window);
71-
72-
this.clearCurrentDragSourceNode();
73-
}
74-
7572
removeEventListeners(target) {
7673
target.removeEventListener('dragstart', this.handleTopDragStart);
7774
target.removeEventListener('dragstart', this.handleTopDragStartCapture, true);

0 commit comments

Comments
 (0)