Skip to content

Commit

Permalink
nest UpdateControlAnchorTitleOptions properties integration:
Browse files Browse the repository at this point in the history
- map.control.anchor
- map.fullscreen
  • Loading branch information
Stassi committed Nov 22, 2024
1 parent 159e083 commit 7f06c33
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
16 changes: 10 additions & 6 deletions src/leaf/map/fullscreen/control/added-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ export function controlAddedListener({
}: ControlAddedListenerOptions): ControlOnAdd {
return function handleControlAdded(map: Map): HTMLElement {
updateControlAnchorTitle({
anchor: {
assign: anchorAssign,
titleStates: anchorTitleStates,
},
fullscreen: {
state: { get: getFullscreenState },
map: {
control: {
anchor: {
assign: anchorAssign,
titleStates: anchorTitleStates,
},
},
fullscreen: {
state: { get: getFullscreenState },
},
},
})

Expand Down
10 changes: 7 additions & 3 deletions src/leaf/map/fullscreen/control/anchor/update-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ export type UpdateControlAnchorTitleOptions = {
}

export function updateControlAnchorTitle({
anchor: { assign: anchorAssign, titleStates: anchorTitleStates },
fullscreen: {
state: { get: getFullscreenState },
map: {
control: {
anchor: { assign: anchorAssign, titleStates: anchorTitleStates },
},
fullscreen: {
state: { get: getFullscreenState },
},
},
}: UpdateControlAnchorTitleOptions): HTMLElement {
return anchorAssign({
Expand Down
8 changes: 6 additions & 2 deletions src/leaf/map/fullscreen/lifecycle-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ export function fullscreenMapLifecycleListener({
map.invalidateSize()
toggleFullscreenState()
updateControlAnchorTitle({
anchor: { assign: anchorAssign, titleStates: anchorTitleStates },
fullscreen: { state: { get: getFullscreenState } },
map: {
control: {
anchor: { assign: anchorAssign, titleStates: anchorTitleStates },
},
fullscreen: { state: { get: getFullscreenState } },
},
})
},
)
Expand Down

0 comments on commit 7f06c33

Please sign in to comment.