From 202c73c35a74d6a72c287f225378a17237a2e897 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 24 Jul 2023 17:49:46 +0200 Subject: [PATCH] Add logo in edit header cf #609 --- umap/static/umap/img/logo_small.svg | 14 ++++++++++++++ umap/static/umap/js/umap.js | 10 +++++----- umap/static/umap/map.css | 16 +++++++++++++++- 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 umap/static/umap/img/logo_small.svg diff --git a/umap/static/umap/img/logo_small.svg b/umap/static/umap/img/logo_small.svg new file mode 100644 index 00000000..40d44b7e --- /dev/null +++ b/umap/static/umap/img/logo_small.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index f9926541..61856aa8 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1810,19 +1810,19 @@ L.U.Map.include({ 'umap-main-edit-toolbox with-transition dark', this._controlContainer ), - title = L.DomUtil.add('h3', '', container, `${L._('Editing')} `), - name = L.DomUtil.create('a', 'umap-click-to-edit', title), + logo = L.DomUtil.add('a', 'logo', container), + name = L.DomUtil.add('a', 'umap-click-to-edit', container, this.getDisplayName()), setName = function () { name.textContent = this.getDisplayName() } + logo.href = '/' if (this.options.user) { - const userLabel = L.DomUtil.add('a', 'umap-user', title, this.options.user.name) + const userLabel = L.DomUtil.add('a', 'umap-user', container, this.options.user.name) userLabel.href = this.options.user.url } - L.bind(setName, this)() + this.help.button(container, 'edit') L.DomEvent.on(name, 'click', this.edit, this) this.on('postsync', L.bind(setName, this)) - this.help.button(name, 'edit') const save = L.DomUtil.create('a', 'leaflet-control-edit-save button', container) save.href = '#' save.title = `${L._('Save current edits')} (Ctrl+S)` diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index ef430474..8e9f6ff2 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -436,6 +436,7 @@ ul.photon-autocomplete { .umap-click-to-edit { color: #4a90d9; font-weight: bold; + cursor: pointer; } .umap-click-to-edit:after { content: "\00a0"; @@ -471,7 +472,20 @@ ul.photon-autocomplete { border-bottom: 1px solid #222; z-index: 1000; opacity: 0.98; - color: #efefef; + color: #fff; +} +.umap-main-edit-toolbox .logo { + background-image: url('./img/logo_small.svg'); + background-position: 10px center; + background-repeat: no-repeat; + width: 60px; + display: inline-block; + height: 100%; + vertical-align: middle; +} +.umap-main-edit-toolbox a { + color: #fff; + font-size: 1.2em; } .umap-edit-enabled .umap-main-edit-toolbox { top: 0;