File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ export class Internal {
59
59
* @type {Function }
60
60
*/
61
61
this . eventHandler = this . handleEvent . bind ( this ) ;
62
+ /**
63
+ * @type {Function }
64
+ */
65
+ this . eventMapMoveHandler = this . handleMapMoveEvent . bind ( this ) ;
62
66
return this ;
63
67
}
64
68
@@ -175,9 +179,7 @@ export class Internal {
175
179
false
176
180
) ;
177
181
178
- this . map . on ( 'movestart' , ( event ) => {
179
- this . closeMenu ( ) ;
180
- } ) ;
182
+ this . map . on ( 'movestart' , this . eventMapMoveHandler ) ;
181
183
}
182
184
183
185
removeListeners ( ) {
@@ -186,6 +188,8 @@ export class Internal {
186
188
this . eventHandler ,
187
189
false
188
190
) ;
191
+
192
+ this . map . un ( 'movestart' , this . eventMapMoveHandler ) ;
189
193
}
190
194
191
195
handleEvent ( evt ) {
@@ -226,6 +230,10 @@ export class Internal {
226
230
) ;
227
231
}
228
232
233
+ handleMapMoveEvent ( evt ) {
234
+ this . closeMenu ( ) ;
235
+ }
236
+
229
237
setItemListener ( li , index ) {
230
238
const this_ = this ;
231
239
if ( li && typeof this . items [ index ] . callback === 'function' ) {
You can’t perform that action at this time.
0 commit comments