mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
fix: update star icon on star/unstar
This commit is contained in:
parent
24511d796d
commit
f93d0b5ca7
2 changed files with 7 additions and 6 deletions
|
@ -1346,6 +1346,11 @@ export default class Umap extends ServerStored {
|
|||
el.textContent = this.sync.getNumberOfConnectedPeers()
|
||||
})
|
||||
},
|
||||
'properties.starred': () => {
|
||||
Utils.eachElement('.map-star', (el) => {
|
||||
el.classList.toggle('starred', this.properties.starred)
|
||||
})
|
||||
},
|
||||
}
|
||||
for (const [field, impact] of Object.entries(impacts)) {
|
||||
if (!fields.length || fields.includes(field)) {
|
||||
|
@ -1531,7 +1536,7 @@ export default class Umap extends ServerStored {
|
|||
? translate('Map has been starred')
|
||||
: translate('Map has been unstarred')
|
||||
)
|
||||
this.render(['starred'])
|
||||
this.render(['properties.starred'])
|
||||
}
|
||||
|
||||
processFileToImport(file, layer, type) {
|
||||
|
|
|
@ -541,11 +541,7 @@ U.StarControl = L.Control.Button.extend({
|
|||
options: {
|
||||
position: 'topleft',
|
||||
title: L._('Star this map'),
|
||||
},
|
||||
|
||||
getClassName: function () {
|
||||
const status = this._umap.properties.starred ? ' starred' : ''
|
||||
return `leaflet-control-star umap-control${status}`
|
||||
className: 'leaflet-control-star map-star umap-control',
|
||||
},
|
||||
|
||||
onClick: function () {
|
||||
|
|
Loading…
Reference in a new issue