diff --git a/umap/static/umap/img/16-white.svg b/umap/static/umap/img/16-white.svg index d3c2c6bd..1de49bb5 100644 --- a/umap/static/umap/img/16-white.svg +++ b/umap/static/umap/img/16-white.svg @@ -190,5 +190,6 @@ + diff --git a/umap/static/umap/img/source/16-white.svg b/umap/static/umap/img/source/16-white.svg index c8dddfeb..11dabbaf 100644 --- a/umap/static/umap/img/source/16-white.svg +++ b/umap/static/umap/img/source/16-white.svg @@ -16,7 +16,7 @@ - + @@ -212,5 +212,6 @@ + diff --git a/umap/static/umap/js/modules/browser.js b/umap/static/umap/js/modules/browser.js index 5f93a22a..63f0f86d 100644 --- a/umap/static/umap/js/modules/browser.js +++ b/umap/static/umap/js/modules/browser.js @@ -219,4 +219,17 @@ export default class Browser { if (!this.isOpen()) return this.map.ui._panel.classList.remove('dark') } + + static backButton (map) { + const button = L.DomUtil.create('li', '') + L.DomUtil.create('i', 'umap-icon-16 umap-back', button) + const label = L.DomUtil.create('span', '', button) + button.title = L._('Back to browser') + // Fixme: remove me when this is merged and released + // https://github.com/Leaflet/Leaflet/pull/9052 + L.DomEvent.disableClickPropagation(button) + L.DomEvent.on(button, 'click', map.openBrowser, map) + return button + } + } diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index e38595ad..58a27e41 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -137,7 +137,11 @@ U.FeatureMixin = { this.appendEditFieldsets(container) const advancedActions = L.DomUtil.createFieldset(container, L._('Advanced actions')) this.getAdvancedEditActions(advancedActions) - this.map.ui.openPanel({ data: { html: container }, className: 'dark' }) + this.map.ui.openPanel({ + data: { html: container }, + className: 'dark', + actions: [U.Browser.backButton(this.map)], + }) this.map.editedFeature = this if (!this.isOnScreen()) this.zoomTo(e) }, diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index 56d36383..7012b2d2 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -1379,7 +1379,11 @@ U.DataLayer = L.Evented.extend({ '_blank' ) } - this.map.ui.openPanel({ data: { html: container }, className: 'dark' }) + this.map.ui.openPanel({ + data: { html: container }, + className: 'dark', + actions: [U.Browser.backButton(this.map)], + }) }, getOwnOption: function (option) { diff --git a/umap/static/umap/js/umap.popup.js b/umap/static/umap/js/umap.popup.js index e070cef6..ced6b1d0 100644 --- a/umap/static/umap/js/umap.popup.js +++ b/umap/static/umap/js/umap.popup.js @@ -54,22 +54,10 @@ U.Popup.Panel = U.Popup.extend({ zoomAnimation: false, }, - allButton: function () { - const button = L.DomUtil.create('li', '') - L.DomUtil.create('i', 'umap-icon-16 umap-back', button) - const label = L.DomUtil.create('span', '', button) - button.title = L._('See all') - // Fixme: remove me when this is merged and released - // https://github.com/Leaflet/Leaflet/pull/9052 - L.DomEvent.disableClickPropagation(button) - L.DomEvent.on(button, 'click', this.feature.map.openBrowser, this.feature.map) - return button - }, - onAdd: function (map) { map.ui.openPanel({ data: { html: this._content }, - actions: [this.allButton()], + actions: [U.Browser.backButton(map)], }) // fire events as in base class Popup.js:onAdd diff --git a/umap/static/umap/js/umap.tableeditor.js b/umap/static/umap/js/umap.tableeditor.js index 19cafbed..2c0a9bf4 100644 --- a/umap/static/umap/js/umap.tableeditor.js +++ b/umap/static/umap/js/umap.tableeditor.js @@ -113,7 +113,7 @@ U.TableEditor = L.Class.extend({ this.datalayer.map.ui.openPanel({ data: { html: this.table }, className: 'umap-table-editor fullwidth dark', - actions: [addButton], + actions: [addButton, U.Browser.backButton(this.datalayer.map)], }) this.datalayer.map.fire('dataload', { id: id }) }, diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index 7d478fb8..648b684c 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -954,8 +954,8 @@ ul.photon-autocomplete { line-height: 24px; vertical-align: middle; } -.umap-browser.dark .datalayer i { - background-image: url('./img/16-white.svg'); +.umap-browser .datalayer i { + cursor: pointer; } .umap-browser ul { display: none; @@ -1145,7 +1145,7 @@ i.drag-handle { background-position: -28px -99px; } .umap-back { - background-position: -122px -144px; + background-position: -122px -150px; } .umap-list-white { background-position: -92px -168px;