diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index 761945b0..92808cc2 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -831,8 +831,9 @@ export class DataLayer extends ServerStored { this ) - if (this._umap.properties.urls.datalayer_versions) + if (this._umap.properties.urls.datalayer_versions) { this.buildVersionsFieldset(container) + } const advancedActions = DomUtil.createFieldset( container, @@ -907,10 +908,15 @@ export class DataLayer extends ServerStored { const appendVersion = (data) => { const date = new Date(Number.parseInt(data.at, 10)) const content = `${date.toLocaleString(U.lang)} (${Number.parseInt(data.size) / 1000}Kb)` - const el = DomUtil.create('div', 'umap-datalayer-version', versionsContainer) - const button = DomUtil.createButton('', el, '', () => this.restore(data.ref)) - button.title = translate('Restore this version') - DomUtil.add('span', '', el, content) + const [el, { button }] = Utils.loadTemplateWithRefs( + `