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 {
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 ) ;
You can’t perform that action at this time.
0 commit comments