Fix closing the alert when clicking on an action button
This commit is contained in:
parent
5d6afdfb1b
commit
cfe6bdf2a8
1 changed files with 2 additions and 2 deletions
|
@ -85,7 +85,7 @@ L.U.UI = L.Evented.extend({
|
||||||
L.DomUtil.addClass(this.parent, 'umap-alert')
|
L.DomUtil.addClass(this.parent, 'umap-alert')
|
||||||
L.DomUtil.addClass(this._alert, level_class)
|
L.DomUtil.addClass(this._alert, level_class)
|
||||||
const close = () => {
|
const close = () => {
|
||||||
if (timeoutID !== this.ALERT_ID) {
|
if (timeoutID && timeoutID !== this.ALERT_ID) {
|
||||||
return
|
return
|
||||||
} // Another alert has been forced
|
} // Another alert has been forced
|
||||||
this._alert.innerHTML = ''
|
this._alert.innerHTML = ''
|
||||||
|
@ -123,7 +123,7 @@ L.U.UI = L.Evented.extend({
|
||||||
L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', close, this)
|
L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', close, this)
|
||||||
if (action.callback)
|
if (action.callback)
|
||||||
L.DomEvent.on(el, 'click', () => {
|
L.DomEvent.on(el, 'click', () => {
|
||||||
action.callback.bind(action.callbackContext || this.map)()
|
action.callback.call(action.callbackContext || this.map)
|
||||||
close()
|
close()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue