Mercurial > gemma
diff client/src/store/fairway.js @ 3146:b6cc4838d2c0
client: implemented pane mechanic for diagrams
regressions: diagrams are currently not collapsible anymore, animations were removed
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Fri, 03 May 2019 10:33:51 +0200 |
parents | 583b6748431f |
children | f64cc98746a1 |
line wrap: on
line diff
--- a/client/src/store/fairway.js Fri May 03 10:31:40 2019 +0200 +++ b/client/src/store/fairway.js Fri May 03 10:33:51 2019 +0200 @@ -109,7 +109,6 @@ state.fairwayData = []; }, clearCurrentProfile: state => { - state.additionalSurvey = null; state.currentProfile = {}; state.minAlt = null; state.maxAlt = null; @@ -132,8 +131,7 @@ } }, actions: { - clearSelection({ commit, dispatch, rootState }) { - dispatch("bottlenecks/setSelectedBottleneck", null, { root: true }); + clearCurrentProfile({ commit, rootState }) { commit("clearCurrentProfile"); commit("map/cutToolEnabled", false, { root: true }); rootState.map.openLayersMaps.forEach(m => { @@ -213,8 +211,6 @@ ); } - commit("application/showSplitscreen", true, { root: true }); - commit("application/splitscreenLoading", true, { root: true }); commit("profileLoading", true); Promise.all(profileLoaders) .then(() => { @@ -295,40 +291,18 @@ }); }) .finally(() => { - let splitscreenConf = { - id: "fairwayprofile", - component: "fairwayprofile", - title: `${rootState.bottlenecks.selectedBottleneck} (${ - rootState.bottlenecks.selectedSurvey.date_info - })`, - icon: "chart-area", - closeCallback: () => { - dispatch("clearSelection"); - }, - expandCallback: () => { - let bottleneck = rootState.bottlenecks.bottlenecksList.find( - bn => - bn.properties.name === - rootState.bottlenecks.selectedBottleneck - ); - dispatch( - "map/moveToFeauture", - { - feature: bottleneck, - zoom: 17, - preventZoomOut: true - }, - { root: true } - ); - } - }; - commit("application/addSplitscreen", splitscreenConf, { - root: true - }); - commit("application/activeSplitscreenId", "fairwayprofile", { - root: true - }); - commit("application/splitscreenLoading", false, { root: true }); + commit("application/paneRotate", 1, { root: true }); + if (state.additionalSurvey) { + commit( + "application/paneSetup", + "COMPARESURVEYS_FAIRWAYPROFILE", + { root: true } + ); + } else { + commit("application/paneSetup", "FAIRWAYPROFILE", { + root: true + }); + } commit("profileLoading", false); }); }