diff --git a/umap/static/umap/js/modules/importer.js b/umap/static/umap/js/modules/importer.js index 658a604b9..02ebd340e 100644 --- a/umap/static/umap/js/modules/importer.js +++ b/umap/static/umap/js/modules/importer.js @@ -64,7 +64,10 @@ export default class Importer extends Utils.WithTemplate { this.TYPES = ['geojson', 'csv', 'gpx', 'kml', 'osm', 'georss', 'umap'] this.IMPORTERS = [] this.loadImporters() - this.dialog = new Dialog({ className: 'importers dark' }) + this.dialog = new Dialog({ + className: 'importers dark', + back: () => this.showImporters(), + }) } loadImporters() { @@ -172,7 +175,7 @@ export default class Importer extends Utils.WithTemplate { button.addEventListener('click', () => plugin.open(this)) grid.appendChild(button) } - this.dialog.open({ template: element, cancel: false, accept: false }) + this.dialog.open({ template: element, cancel: false, accept: false, back: false }) } build() { diff --git a/umap/static/umap/js/modules/ui/dialog.js b/umap/static/umap/js/modules/ui/dialog.js index cc7d1a1ea..0168fafaa 100644 --- a/umap/static/umap/js/modules/ui/dialog.js +++ b/umap/static/umap/js/modules/ui/dialog.js @@ -6,6 +6,7 @@ const TEMPLATE = `

@@ -123,6 +124,10 @@ export default class Dialog extends WithTemplate { } else { this.elements.template.innerHTML = dialog.template || '' } + this.elements.back.hidden = !dialog.back + if (dialog.back) { + this.elements.back.addEventListener('click', dialog.back) + } this.focusable = this.getFocusable() this.hasFormData = this.elements.fieldset.elements.length > 0