File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8080 var target = e . target || e . srcElement ;
8181 var state = cm . state . lint
8282
83+ if ( state . hints ) {
84+ remove ( state . hints )
85+ }
86+
8387 if ( ! menus && menus . length > 0 ) {
8488 return
8589 }
104108 if ( typeof onClick === 'function' ) {
105109 onClick ( e )
106110 }
107- remove ( )
111+ remove ( hints )
108112 } )
109113 }
110114
111- function remove ( ) {
115+ var removal = function ( ) { setTimeout ( function ( ) { remove ( hints ) } , 100 ) }
116+ function remove ( hints ) {
112117 if ( hints . parentNode ) {
113118 hints . parentNode . removeChild ( hints )
114119 }
115120 state . hints = null
116- }
117-
118- if ( state . hints ) {
119- remove ( )
121+
122+ cm . off ( "mousedown" , removal )
123+ cm . off ( "scroll" , removal )
120124 }
121125
122126 state . hints = hints
125129
126130 hints . style . top = top + 5 + 'px'
127131 hints . style . left = left + 20 + 'px'
132+
133+
134+ cm . on ( "mousedown" , removal )
135+ cm . on ( "scroll" , removal )
128136 }
129137
130138 function LintState ( cm , options , hasGutter ) {
Original file line number Diff line number Diff line change @@ -170,13 +170,13 @@ <h2>Linter Demo</h2>
170170 contextmenu : annotations => ( [
171171 {
172172 content : 'Fix me' ,
173- onClick ( e , annotations ) {
173+ onClick ( e ) {
174174 console . log ( annotations )
175175 }
176176 } ,
177177 {
178178 content : 'Another fixed me' ,
179- onClick ( e , annotations ) {
179+ onClick ( e ) {
180180 console . log ( annotations )
181181 }
182182 }
You can’t perform that action at this time.
0 commit comments