From 6eec608eb12547ffec5b3db65ce89fb3e3011743 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Tue, 18 May 2021 22:01:07 +0100 Subject: [PATCH] Improve handling of component config updates --- src/components/Map.vue | 2 +- src/components/map/control/ClockControl.vue | 18 ++++++++-- .../map/control/CoordinatesControl.vue | 33 +++++++++---------- src/scss/leaflet/_controls.scss | 13 ++++++-- src/store/mutations.ts | 2 +- 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/src/components/Map.vue b/src/components/Map.vue index 1f414d7..960fe13 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -20,7 +20,7 @@ - + diff --git a/src/components/map/control/ClockControl.vue b/src/components/map/control/ClockControl.vue index 10f938c..fe70951 100644 --- a/src/components/map/control/ClockControl.vue +++ b/src/components/map/control/ClockControl.vue @@ -15,10 +15,11 @@ --> - - \ No newline at end of file diff --git a/src/scss/leaflet/_controls.scss b/src/scss/leaflet/_controls.scss index ad8c84d..180e0af 100644 --- a/src/scss/leaflet/_controls.scss +++ b/src/scss/leaflet/_controls.scss @@ -260,8 +260,17 @@ padding-bottom: 1rem; align-items: stretch; - &.leaflet-left .leaflet-control + .leaflet-control { - margin-left: 1rem; + .leaflet-control { + order: 2; + } + + /* Always show before other controls */ + .leaflet-control-link { + order: 1; + } + + &.leaflet-left .leaflet-control { + margin-right: 1rem; } @media (max-width: 400px), (max-height: 480px) { diff --git a/src/store/mutations.ts b/src/store/mutations.ts index 796014a..610b5c8 100644 --- a/src/store/mutations.ts +++ b/src/store/mutations.ts @@ -150,7 +150,7 @@ export const mutations: MutationTree & Mutations = { //Sets the state and settings of optional components, from the initial config fetch [MutationTypes.SET_COMPONENTS](state: State, components: DynmapComponentConfig) { - state.components = components; + state.components = Object.assign(state.components, components); }, //Sets the existing marker sets from the last marker fetch