From fcd9a0eef11e65da76ecfaf0daf65a20a59a4821 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 13 Oct 2018 14:19:42 +0200 Subject: [PATCH] Table popup should inherit BaseWithTitle fix #647 --- umap/static/umap/js/umap.popup.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/umap/static/umap/js/umap.popup.js b/umap/static/umap/js/umap.popup.js index 95316037..fd7d9f75 100644 --- a/umap/static/umap/js/umap.popup.js +++ b/umap/static/umap/js/umap.popup.js @@ -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) { 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({ options: {