mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 11:32:38 +02:00
fix: fix icon and button for version restore
Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
parent
be83eddbd0
commit
64c7fe1ec9
2 changed files with 11 additions and 21 deletions
|
@ -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(
|
||||
`<div class="umap-datalayer-version">
|
||||
<button type="button" title="${translate('Restore this version')}" data-ref=button>
|
||||
<i class="icon icon-16 icon-restore"></i> ${content}
|
||||
</button>
|
||||
</div>`
|
||||
)
|
||||
versionsContainer.appendChild(el)
|
||||
button.addEventListener('click', () => this.restore(data.ref))
|
||||
}
|
||||
|
||||
const versionsContainer = DomUtil.createFieldset(container, translate('Versions'), {
|
||||
|
|
|
@ -475,22 +475,6 @@ ul.photon-autocomplete {
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umap-datalayer-version {
|
||||
padding: 5px 0;
|
||||
border-bottom: 1px solid #202425;
|
||||
}
|
||||
.umap-datalayer-version button {
|
||||
display: inline-block;
|
||||
width: 24px;
|
||||
min-height: 24px;
|
||||
background-position: -122px -73px;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url('./img/16-white.svg');
|
||||
margin-inline-end: 10px;
|
||||
}
|
||||
|
||||
.leaflet-toolbar-tip {
|
||||
background-color: var(--color-darkGray);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue