# HG changeset patch # User Markus Kottlaender # Date 1552031447 -3600 # Node ID 9bf6b767a56a8b4f61fa0ef2186ab6f2748d8896 # Parent 6b34d0fb44983b8542118f46878432841d133287 client: refactored and improved splitscreen for diagrams To make different diagrams possible, the splitscreen view needed to be decoupled from the cross profiles. Also the style has changed to make it more consistent with the rest of the app. The standard box header is now used and there are collapse and expand animations. diff -r 6b34d0fb4498 -r 9bf6b767a56a client/src/assets/application.scss --- a/client/src/assets/application.scss Thu Mar 07 20:03:43 2019 +0100 +++ b/client/src/assets/application.scss Fri Mar 08 08:50:47 2019 +0100 @@ -35,6 +35,10 @@ font-weight: bold; } +html { + overflow: hidden; +} + a { color: $color-info; } diff -r 6b34d0fb4498 -r 9bf6b767a56a client/src/components/App.vue --- a/client/src/components/App.vue Thu Mar 07 20:03:43 2019 +0100 +++ b/client/src/components/App.vue Fri Mar 08 08:50:47 2019 +0100 @@ -26,6 +26,7 @@ +
@@ -34,10 +35,6 @@ diff -r 6b34d0fb4498 -r 9bf6b767a56a client/src/components/Zoom.vue --- a/client/src/components/Zoom.vue Thu Mar 07 20:03:43 2019 +0100 +++ b/client/src/components/Zoom.vue Fri Mar 08 08:50:47 2019 +0100 @@ -29,6 +29,7 @@ bottom: 0; left: 50%; margin-left: -$icon-width; + transition: margin-bottom 0.3s; } .zoomButton { diff -r 6b34d0fb4498 -r 9bf6b767a56a client/src/components/fairway/Fairwayprofile.vue --- a/client/src/components/fairway/Fairwayprofile.vue Thu Mar 07 20:03:43 2019 +0100 +++ b/client/src/components/fairway/Fairwayprofile.vue Fri Mar 08 08:50:47 2019 +0100 @@ -1,92 +1,7 @@ - - diff -r 6b34d0fb4498 -r 9bf6b767a56a client/src/store/application.js --- a/client/src/store/application.js Thu Mar 07 20:03:43 2019 +0100 +++ b/client/src/store/application.js Fri Mar 08 08:50:47 2019 +0100 @@ -26,6 +26,8 @@ showSidebar: false, showUsermenu: false, showSplitscreen: false, + splitscreenLoading: false, + splitscreen: null, showSearchbar: false, showSearchbarLastState: false, showIdentify: false, @@ -75,6 +77,12 @@ showSplitscreen: (state, show) => { state.showSplitscreen = show; }, + splitscreenLoading: (state, loading) => { + state.splitscreenLoading = loading; + }, + splitscreen: (state, config) => { + state.splitscreen = config; + }, showUsermenu: (state, show) => { state.showUsermenu = show; }, diff -r 6b34d0fb4498 -r 9bf6b767a56a client/src/store/bottlenecks.js --- a/client/src/store/bottlenecks.js Thu Mar 07 20:03:43 2019 +0100 +++ b/client/src/store/bottlenecks.js Fri Mar 08 08:50:47 2019 +0100 @@ -65,8 +65,11 @@ return new Promise((resolve, reject) => { if (name !== state.selectedBottleneck) { commit("selectedSurvey", null); - commit("fairwayprofile/clearCurrentProfile", null, { root: true }); + commit("application/splitscreenLoading", true, { root: true }); commit("application/showSplitscreen", false, { root: true }); + setTimeout(() => { + commit("fairwayprofile/clearCurrentProfile", null, { root: true }); + }, 350); rootState.map.cutTool.setActive(false); rootGetters["map/getVSourceByName"](LAYERS.CUTTOOL).clear(); } diff -r 6b34d0fb4498 -r 9bf6b767a56a client/src/store/fairway.js --- a/client/src/store/fairway.js Thu Mar 07 20:03:43 2019 +0100 +++ b/client/src/store/fairway.js Fri Mar 08 08:50:47 2019 +0100 @@ -133,7 +133,6 @@ dispatch("bottlenecks/setSelectedBottleneck", null, { root: true }); dispatch("map/enableIdentifyTool", null, { root: true }); commit("clearCurrentProfile"); - commit("application/showSplitscreen", false, { root: true }); rootState.map.cutTool.setActive(false); rootGetters["map/getVSourceByName"](LAYERS.CUTTOOL).clear(); }, @@ -161,7 +160,6 @@ resolve(response); } else { commit("clearCurrentProfile"); - commit("application/showSplitscreen", false, { root: true }); reject({ response: { status: null, @@ -209,6 +207,8 @@ ); } + commit("application/showSplitscreen", true, { root: true }); + commit("application/splitscreenLoading", true, { root: true }); commit("profileLoading", true); Promise.all(profileLoaders) .then(() => { @@ -232,7 +232,6 @@ }; if (fairwayCoordinates.length > 0) { commit("addFairwayData", fairwayData); - commit("application/showSplitscreen", true, { root: true }); } } ); @@ -255,7 +254,6 @@ }; if (fairwayCoordinates.length > 0) { commit("addFairwayData", fairwayData); - commit("application/showSplitscreen", true, { root: true }); } } ); @@ -278,7 +276,6 @@ }; if (fairwayCoordinates.length > 0) { commit("addFairwayData", fairwayData); - commit("application/showSplitscreen", true, { root: true }); } } ); @@ -292,6 +289,21 @@ }); }) .finally(() => { + commit( + "application/splitscreen", + { + component: "fairwayprofile", + title: `${rootState.bottlenecks.selectedBottleneck} (${ + rootState.bottlenecks.selectedSurvey.date_info + })`, + icon: "chart-area", + closeCallback: () => { + dispatch("clearSelection"); + } + }, + { root: true } + ); + commit("application/splitscreenLoading", false, { root: true }); commit("profileLoading", false); }); }