fire events from Popup Panel

to also highlight path and markers when using the side panel.
Therefore we duplicate the event code from the base class.
This commit is contained in:
Joachim Schleicher 2023-10-10 10:01:16 +02:00
parent 3594bc2605
commit 836c17f2e8

View file

@ -68,10 +68,28 @@ L.U.Popup.Panel = L.U.Popup.extend({
data: { html: this._content },
actions: [this.allButton()],
})
// fire events as in base class Popup.js:onAdd
map.fire('popupopen', {popup: this})
if (this._source) {
this._source.fire('popupopen', {popup: this}, true);
if (!(this._source instanceof L.Path)) {
this._source.on('preclick', L.DomEvent.stopPropagation);
}
}
},
onRemove: function (map) {
map.ui.closePanel()
// fire events as in base class Popup.js:onRemove
map.fire('popupclose', {popup: this});
if (this._source) {
this._source.fire('popupclose', {popup: this}, true);
if (!(this._source instanceof L.Path)) {
this._source.off('preclick', L.DomEvent.stopPropagation);
}
}
},
update: function () {},