Skip to content

Commit

Permalink
updateTitle restores dynamic title update functionality of original…
Browse files Browse the repository at this point in the history
… fullscreen control extension
  • Loading branch information
Stassi committed Nov 13, 2024
1 parent 36ea0e6 commit 92e9e57
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions public/script/leaflet-fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ function createFullscreenControl(options = {}, getFullscreen, setFullscreen) {
toggleFullscreen(map, mergedOptions, getFullscreen, setFullscreen)
})

function updateTitle() {
Object.assign(link, { title: mergedOptions.title[getFullscreen()] })
}

updateTitle()
map.on('fullscreenchange', updateTitle)

return container
}

Expand Down

0 comments on commit 92e9e57

Please sign in to comment.