File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,9 @@ class InfoWindow extends UIComponent {
144
144
const isFunc = isFunction ( this . options [ 'content' ] ) ;
145
145
const isStr = isString ( this . options [ 'content' ] ) ;
146
146
if ( this . options [ 'custom' ] ) {
147
+ const oldDom = this . getDOM ( ) ;
148
+ let newDom ;
149
+ this . _bindDomEvents ( oldDom , 'off' ) ;
147
150
if ( isStr || isFunc ) {
148
151
const dom = createEl ( 'div' ) ;
149
152
if ( isStr ) {
@@ -153,11 +156,13 @@ class InfoWindow extends UIComponent {
153
156
//dymatic render dom content
154
157
this . options [ 'content' ] . bind ( this ) ( dom ) ;
155
158
}
156
- return dom ;
159
+ newDom = dom ;
157
160
} else {
158
161
this . _replaceTemplate ( this . options [ 'content' ] ) ;
159
- return this . options [ 'content' ] ;
162
+ newDom = this . options [ 'content' ] ;
160
163
}
164
+ this . _bindDomEvents ( newDom , 'on' ) ;
165
+ return newDom ;
161
166
}
162
167
this . _bindDomEvents ( this . getDOM ( ) , 'off' ) ;
163
168
const dom = createEl ( 'div' ) ;
You can’t perform that action at this time.
0 commit comments