diff client/src/components/fairway/Fairwayprofile.vue @ 2549:9bf6b767a56a

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.
author Markus Kottlaender <markus@intevation.de>
date Fri, 08 Mar 2019 08:50:47 +0100
parents 3c17d401fbd4
children 83b938bf4da9
line wrap: on
line diff
--- 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 @@
 <template>
-  <div :class="['position-relative', { show: showSplitscreen }]">
-    <div class="profile bg-white position-relative d-flex flex-column">
-      <div
-        class="d-flex flex-row justify-content-between align-items-center border-bottom position-relative"
-      >
-        <div class="flex-row mr-auto ml-auto">
-          <h5
-            class="headline mb-0 py-2"
-            v-if="selectedBottleneck && selectedSurvey"
-          >
-            {{ selectedBottleneck }} ({{ selectedSurvey.date_info }})
-          </h5>
-        </div>
-        <div>
-          <button
-            class="rounded-bottom bg-white border-0 splitscreen-toggle"
-            @click="$store.commit('application/showSplitscreen', false)"
-            v-if="showSplitscreen"
-          >
-            <font-awesome-icon icon="angle-down" />
-          </button>
-          <button
-            class="rounded-bottom bg-white border-0 clear-selection"
-            @click="$store.dispatch('fairwayprofile/clearSelection')"
-            v-if="showSplitscreen"
-          >
-            <font-awesome-icon icon="times" class="pointer" />
-          </button>
-        </div>
-      </div>
-      <div class="d-flex flex-fill">
-        <div
-          class="loading d-flex justify-content-center align-items-center"
-          v-if="surveysLoading || profileLoading"
-        >
-          <font-awesome-icon icon="spinner" spin />
-        </div>
-        <div class="fairwayprofile m-3 mt-0 bg-white flex-grow-1"></div>
-      </div>
-    </div>
-  </div>
+  <div class="fairwayprofile m-3 mt-0 bg-white flex-grow-1"></div>
 </template>
 
-<style lang="scss" scoped>
-.profile {
-  width: 100vw;
-  height: 0;
-  overflow: hidden;
-  z-index: 2;
-}
-
-.splitscreen-toggle,
-.clear-selection {
-  width: 2rem;
-  height: 2rem;
-  margin-top: 8px;
-  z-index: 3;
-  outline: none;
-}
-
-.splitscreen-toggle svg path,
-.clear-selection svg path {
-  fill: #666;
-}
-
-.splitscreen-toggle {
-  right: 2.5rem;
-}
-
-.clear-selection {
-  right: 0.5rem;
-}
-
-.show .profile {
-  height: 50vh;
-}
-
-.loading {
-  background: rgba(255, 255, 255, 0.96);
-  position: absolute;
-  z-index: 99;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-}
-</style>
-
 <script>
 /* This is Free Software under GNU Affero General Public License v >= 3.0
  * without warranty, see README.md and license for details.
@@ -100,6 +15,7 @@
  *
  * Author(s):
  * Thomas Junk <thomas.junk@intevation.de>
+ * Markus Kottländer <markus.kottlaender@intevation.de>
  */
 import * as d3 from "d3";
 import { mapState, mapGetters } from "vuex";
@@ -127,7 +43,6 @@
   },
   computed: {
     ...mapGetters("fairwayprofile", ["totalLength"]),
-    ...mapState("application", ["showSplitscreen"]),
     ...mapState("fairwayprofile", [
       "additionalSurvey",
       "currentProfile",
@@ -135,17 +50,12 @@
       "fairwayData",
       "minAlt",
       "maxAlt",
-      "profileLoading",
       "referenceWaterLevel",
       "selectedWaterLevel",
       "startPoint",
       "waterLevels"
     ]),
-    ...mapState("bottlenecks", [
-      "selectedBottleneck",
-      "selectedSurvey",
-      "surveysLoading"
-    ]),
+    ...mapState("bottlenecks", ["selectedSurvey"]),
     relativeWaterLevelDelta() {
       return this.selectedWaterLevel.value - this.referenceWaterLevel;
     },