From a74439ac471f745e48d5bef1de2ec829067b75d8 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 24 Jul 2023 19:17:05 +0200 Subject: [PATCH] Remove click-to-edit --- umap/static/umap/js/umap.js | 3 ++- umap/static/umap/map.css | 32 ++++++++++++-------------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 61856aa8..c59b0e3c 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1811,10 +1811,11 @@ L.U.Map.include({ this._controlContainer ), logo = L.DomUtil.add('a', 'logo', container), - name = L.DomUtil.add('a', 'umap-click-to-edit', container, this.getDisplayName()), + name = L.DomUtil.add('a', 'map-name', container, this.getDisplayName()), setName = function () { name.textContent = this.getDisplayName() } + name.href = '#' logo.href = '/' if (this.options.user) { const userLabel = L.DomUtil.add('a', 'umap-user', container, this.options.user.name) diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index 8e9f6ff2..9c44b146 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -433,26 +433,8 @@ ul.photon-autocomplete { .umap-is-dirty a.leaflet-control-edit-disable { display: none; } -.umap-click-to-edit { - color: #4a90d9; - font-weight: bold; - cursor: pointer; -} -.umap-click-to-edit:after { - content: "\00a0"; - background-repeat: no-repeat; - background-position: center center; - cursor: pointer; - width: 26px; - height: 100%; - display: inline-block; - background-position: -46px -41px; -} -.umap-click-to-edit:hover:after { - background-image: url('./img/16.svg'); -} -.dark .umap-click-to-edit:hover:after { - background-image: url('./img/16-white.svg'); +.umap-click-to-edit:hover { + text-decoration: underline; } .umap-caption-bar { display: none; @@ -487,6 +469,16 @@ ul.photon-autocomplete { color: #fff; font-size: 1.2em; } +.umap-main-edit-toolbox .map-name { + display: inline-block; + max-width: 200px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + vertical-align: middle; + margin-right: 5px; + font-weight: bold; +} .umap-edit-enabled .umap-main-edit-toolbox { top: 0; }