This repository was archived by the owner on Jun 18, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,19 @@ export default class HTML5Backend {
43
43
throw new Error ( 'Cannot have two HTML5 backends at the same time.' ) ;
44
44
}
45
45
this . constructor . isSetUp = true ;
46
-
47
46
this . addEventListeners ( window ) ;
48
47
}
49
48
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
+
50
59
addEventListeners ( target ) {
51
60
target . addEventListener ( 'dragstart' , this . handleTopDragStart ) ;
52
61
target . addEventListener ( 'dragstart' , this . handleTopDragStartCapture , true ) ;
@@ -60,18 +69,6 @@ export default class HTML5Backend {
60
69
target . addEventListener ( 'drop' , this . handleTopDropCapture , true ) ;
61
70
}
62
71
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
-
75
72
removeEventListeners ( target ) {
76
73
target . removeEventListener ( 'dragstart' , this . handleTopDragStart ) ;
77
74
target . removeEventListener ( 'dragstart' , this . handleTopDragStartCapture , true ) ;
You can’t perform that action at this time.
0 commit comments