mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
fixup: allow to display asynchronous content in the panel too
This commit is contained in:
parent
8a929d2352
commit
b7173d4629
2 changed files with 8 additions and 6 deletions
|
@ -199,8 +199,9 @@ class Feature {
|
|||
this._umap.slideshow.current = this
|
||||
}
|
||||
this._umap.currentFeature = this
|
||||
this.attachPopup()
|
||||
this.ui.openPopup(latlng || this.center)
|
||||
this.attachPopup().then(() => {
|
||||
this.ui.openPopup(latlng || this.center)
|
||||
})
|
||||
}
|
||||
|
||||
render(fields) {
|
||||
|
@ -355,9 +356,11 @@ class Feature {
|
|||
return loadPopup(this.getOption('popupShape') || old)
|
||||
}
|
||||
|
||||
attachPopup() {
|
||||
async attachPopup() {
|
||||
const Class = this.getPopupClass()
|
||||
this.ui.bindPopup(new Class(this))
|
||||
const popup = new Class(this)
|
||||
this.ui.bindPopup(popup)
|
||||
return popup.loadContent()
|
||||
}
|
||||
|
||||
async confirmDelete() {
|
||||
|
|
|
@ -22,10 +22,9 @@ const Popup = BasePopup.extend({
|
|||
initialize: function (feature) {
|
||||
this.feature = feature
|
||||
BasePopup.prototype.initialize.call(this, {}, feature.ui)
|
||||
this.getContentFromTemplate()
|
||||
},
|
||||
|
||||
getContentFromTemplate: async function () {
|
||||
loadContent: async function () {
|
||||
const container = DomUtil.create('div', 'umap-popup')
|
||||
const name = this.feature.getOption('popupTemplate')
|
||||
this.content = await loadTemplate(name, this.feature, container)
|
||||
|
|
Loading…
Reference in a new issue