Table popup should inherit BaseWithTitle

fix #647
This commit is contained in:
Yohan Boniface 2018-10-13 14:19:42 +02:00
parent a421698a60
commit fcd9a0eef1

View file

@ -138,8 +138,21 @@ L.U.PopupTemplate.Default = L.Class.extend({
}); });
L.U.PopupTemplate.BaseWithTitle = L.U.PopupTemplate.Default.extend({
L.U.PopupTemplate.Table = L.U.PopupTemplate.Default.extend({ renderTitle: function () {
var title;
if (this.feature.getDisplayName()) {
title = L.DomUtil.create('h3', 'popup-title');
title.innerHTML = L.Util.escapeHTML(this.feature.getDisplayName());
}
return title;
}
});
L.U.PopupTemplate.Table = L.U.PopupTemplate.BaseWithTitle.extend({
formatRow: function (key, value) { formatRow: function (key, value) {
if (value.indexOf('http') === 0) { if (value.indexOf('http') === 0) {
@ -167,19 +180,6 @@ L.U.PopupTemplate.Table = L.U.PopupTemplate.Default.extend({
}); });
L.U.PopupTemplate.BaseWithTitle = L.U.PopupTemplate.Default.extend({
renderTitle: function () {
var title;
if (this.feature.getDisplayName()) {
title = L.DomUtil.create('h3', 'popup-title');
title.innerHTML = L.Util.escapeHTML(this.feature.getDisplayName());
}
return title;
}
});
L.U.PopupTemplate.GeoRSSImage = L.U.PopupTemplate.BaseWithTitle.extend({ L.U.PopupTemplate.GeoRSSImage = L.U.PopupTemplate.BaseWithTitle.extend({
options: { options: {