File tree 1 file changed +18
-4
lines changed
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 57
57
}
58
58
} )
59
59
. on ( 'dropactivate' , function ( event ) {
60
- addClass ( event . target , '-drop-possible' ) ;
61
- event . target . textContent = 'Drop me here!' ;
60
+ var active = event . target . getAttribute ( 'active' ) | 0 ;
62
61
62
+ // change style if it was previously not active
63
+ if ( active === 0 ) {
64
+ addClass ( event . target , '-drop-possible' ) ;
65
+ event . target . textContent = 'Drop me here!' ;
66
+ }
67
+
68
+ event . target . setAttribute ( 'active' , active + 1 ) ;
63
69
} )
64
70
. on ( 'dropdeactivate' , function ( event ) {
65
- removeClass ( event . target , '-drop-possible' ) ;
66
- event . target . textContent = 'Dropzone' ;
71
+ var active = event . target . getAttribute ( 'active' ) | 0 ;
72
+
73
+ // change style if it was previously active
74
+ // but will no longer be active
75
+ if ( active === 1 ) {
76
+ removeClass ( event . target , '-drop-possible' ) ;
77
+ event . target . textContent = 'Dropzone' ;
78
+ }
79
+
80
+ event . target . setAttribute ( 'active' , active - 1 ) ;
67
81
} )
68
82
. on ( 'dragenter' , function ( event ) {
69
83
addClass ( event . target , '-drop-over' ) ;
You can’t perform that action at this time.
0 commit comments