@@ -199,11 +199,11 @@ export class GeocoderControl extends EventedControl {
199
199
) ;
200
200
L . DomEvent . disableClickPropagation ( this . _alts ) ;
201
201
202
- L . DomEvent . addListener ( input , 'keydown' , this . _keydown , this ) ;
202
+ L . DomEvent . on ( input , 'keydown' , this . _keydown , this ) ;
203
203
if ( this . options . geocoder ?. suggest ) {
204
- L . DomEvent . addListener ( input , 'input' , this . _change , this ) ;
204
+ L . DomEvent . on ( input , 'input' , this . _change , this ) ;
205
205
}
206
- L . DomEvent . addListener ( input , 'blur' , ( ) => {
206
+ L . DomEvent . on ( input , 'blur' , ( ) => {
207
207
if ( this . options . collapsed && ! this . _preventBlurCollapse ) {
208
208
this . _collapse ( ) ;
209
209
}
@@ -212,13 +212,13 @@ export class GeocoderControl extends EventedControl {
212
212
213
213
if ( this . options . collapsed ) {
214
214
if ( this . options . expand === 'click' ) {
215
- L . DomEvent . addListener ( container , 'click' , ( e : Event ) => {
215
+ L . DomEvent . on ( container , 'click' , ( e : Event ) => {
216
216
if ( ( e as MouseEvent ) . button === 0 && ( e as MouseEvent ) . detail !== 2 ) {
217
217
this . _toggle ( ) ;
218
218
}
219
219
} ) ;
220
220
} else if ( this . options . expand === 'touch' ) {
221
- L . DomEvent . addListener (
221
+ L . DomEvent . on (
222
222
container ,
223
223
L . Browser . touch ? 'touchstart mousedown' : 'mousedown' ,
224
224
( e : Event ) => {
@@ -229,16 +229,16 @@ export class GeocoderControl extends EventedControl {
229
229
this
230
230
) ;
231
231
} else {
232
- L . DomEvent . addListener ( container , 'mouseover' , this . _expand , this ) ;
233
- L . DomEvent . addListener ( container , 'mouseout' , this . _collapse , this ) ;
232
+ L . DomEvent . on ( container , 'mouseover' , this . _expand , this ) ;
233
+ L . DomEvent . on ( container , 'mouseout' , this . _collapse , this ) ;
234
234
this . _map . on ( 'movestart' , this . _collapse , this ) ;
235
235
}
236
236
} else {
237
237
this . _expand ( ) ;
238
238
if ( L . Browser . touch ) {
239
- L . DomEvent . addListener ( container , 'touchstart' , ( ) => this . _geocode ( ) ) ;
239
+ L . DomEvent . on ( container , 'touchstart' , ( ) => this . _geocode ( ) ) ;
240
240
} else {
241
- L . DomEvent . addListener ( container , 'click' , ( ) => this . _geocode ( ) ) ;
241
+ L . DomEvent . on ( container , 'click' , ( ) => this . _geocode ( ) ) ;
242
242
}
243
243
}
244
244
@@ -403,7 +403,7 @@ export class GeocoderControl extends EventedControl {
403
403
// Use mousedown and not click, since click will fire _after_ blur,
404
404
// causing the control to have collapsed and removed the items
405
405
// before the click can fire.
406
- L . DomEvent . addListener ( li , 'mousedown touchstart' , mouseDownHandler , this ) ;
406
+ L . DomEvent . on ( li , 'mousedown touchstart' , mouseDownHandler , this ) ;
407
407
408
408
return li ;
409
409
}
0 commit comments