diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index bd9c7a28..82cba270 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -592,7 +592,7 @@ i.info { .with-transition { transition: all .7s; } -.umap-delete:before, .umap-empty:before, .umap-to-polygon:before, +.umap-empty:before, .umap-to-polygon:before, .umap-clone:before, .umap-edit:before, .umap-download:before, .umap-to-polyline:before { background-repeat: no-repeat; @@ -604,7 +604,7 @@ i.info { vertical-align: bottom; content: " "; } -.dark .umap-delete:before, .dark .umap-empty:before, +.dark .umap-empty:before, .dark .umap-to-polygon:before, .dark .umap-clone:before, .dark .umap-edit:before, .dark .umap-download:before, diff --git a/umap/static/umap/css/icon.css b/umap/static/umap/css/icon.css index 9375b54d..9cca7461 100644 --- a/umap/static/umap/css/icon.css +++ b/umap/static/umap/css/icon.css @@ -17,7 +17,6 @@ .icon-24 { background-image: url('../img/24.svg'); --tile: -36px; - margin-inline-start: -6px; height: 36px; line-height: 36px; width: 36px; diff --git a/umap/static/umap/img/24-white.svg b/umap/static/umap/img/24-white.svg index b1792024..9994fb77 100644 --- a/umap/static/umap/img/24-white.svg +++ b/umap/static/umap/img/24-white.svg @@ -1,4 +1,4 @@ - + @@ -6,7 +6,7 @@ - + @@ -19,8 +19,8 @@ - - + + diff --git a/umap/static/umap/img/24.svg b/umap/static/umap/img/24.svg index a4fc8d62..9c98ddbc 100644 --- a/umap/static/umap/img/24.svg +++ b/umap/static/umap/img/24.svg @@ -1,4 +1,4 @@ - + @@ -6,7 +6,7 @@ - + 0 @@ -24,12 +24,12 @@ - - + + - + @@ -83,7 +83,7 @@ - + diff --git a/umap/static/umap/img/source/24-white.svg b/umap/static/umap/img/source/24-white.svg index 80d9b3e6..186f6a2e 100644 --- a/umap/static/umap/img/source/24-white.svg +++ b/umap/static/umap/img/source/24-white.svg @@ -1,17 +1,10 @@ - - - - - - - - - - - + + + + @@ -27,7 +20,7 @@ - + @@ -40,8 +33,8 @@ - - + + diff --git a/umap/static/umap/img/source/24.svg b/umap/static/umap/img/source/24.svg index 0d463125..9ec64a94 100644 --- a/umap/static/umap/img/source/24.svg +++ b/umap/static/umap/img/source/24.svg @@ -1,17 +1,10 @@ - - - - - - - - - - - + + + + @@ -26,7 +19,7 @@ - + 0 @@ -44,12 +37,12 @@ - - + + - + @@ -102,8 +95,8 @@ - - + + diff --git a/umap/static/umap/js/modules/data/features.js b/umap/static/umap/js/modules/data/features.js index 4a1daf4c..385f5c8c 100644 --- a/umap/static/umap/js/modules/data/features.js +++ b/umap/static/umap/js/modules/data/features.js @@ -261,9 +261,14 @@ class Feature { } getAdvancedEditActions(container) { - DomUtil.createButton('button umap-delete', container, translate('Delete'), () => { + const button = Utils.loadTemplate(` + ${translate('Delete')} + `) + button.addEventListener('click', () => { this.confirmDelete().then(() => this.map.editPanel.close()) }) + container.appendChild(button) } appendEditFieldsets(container) { diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index 151eee46..fb1fac9f 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -773,16 +773,16 @@ export class DataLayer { translate('Advanced actions') ) const advancedButtons = DomUtil.create('div', 'button-bar half', advancedActions) - const deleteLink = DomUtil.createButton( - 'button delete_datalayer_button umap-delete', - advancedButtons, - translate('Delete'), - function () { - this._delete() - this.map.editPanel.close() - }, - this - ) + const deleteButton = Utils.loadTemplate(` + `) + deleteButton.addEventListener('click', () => { + this._delete() + this.map.editPanel.close() + }) + advancedButtons.appendChild(deleteButton) + if (!this.isRemoteLayer()) { const emptyLink = DomUtil.createButton( 'button umap-empty', diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 2e8944dd..0e060182 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1459,13 +1459,13 @@ U.Map = L.Map.extend({ const advancedActions = L.DomUtil.createFieldset(container, L._('Advanced actions')) const advancedButtons = L.DomUtil.create('div', 'button-bar half', advancedActions) if (this.permissions.isOwner()) { - L.DomUtil.createButton( - 'button umap-delete', - advancedButtons, - L._('Delete'), - this.del, - this - ) + const deleteButton = U.Utils.loadTemplate(` + `) + deleteButton.addEventListener('click', () => this.del()) + advancedButtons.appendChild(deleteButton) + L.DomUtil.createButton( 'button umap-empty', advancedButtons,