Allow to use Infinity for an alert duration
This commit is contained in:
parent
69bf6593ac
commit
7f2545f09b
2 changed files with 7 additions and 5 deletions
|
@ -1339,7 +1339,7 @@ L.U.Map.include({
|
|||
let duration = 3000,
|
||||
alert = { content: L._('Map has been saved!'), level: 'info' }
|
||||
if (!this.options.umap_id) {
|
||||
alert.duration = 100000 // we want a longer message at map creation (TODO UGLY)
|
||||
alert.duration = Infinity
|
||||
this.options.umap_id = data.id
|
||||
this.permissions.setOptions(data.permissions)
|
||||
if (data.permissions && data.permissions.anonymous_edit_url) {
|
||||
|
|
|
@ -124,10 +124,12 @@ L.U.UI = L.Evented.extend({
|
|||
)
|
||||
}
|
||||
}
|
||||
self.ALERT_ID = timeoutID = window.setTimeout(
|
||||
if (e.duration !== Infinity) {
|
||||
this.ALERT_ID = timeoutID = window.setTimeout(
|
||||
L.bind(close, this),
|
||||
e.duration || 3000
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
tooltip: function (e) {
|
||||
|
|
Loading…
Reference in a new issue