diff client/src/components/ui/UIBoxHeader.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 02d30251d594
children 83b938bf4da9
line wrap: on
line diff
--- a/client/src/components/ui/UIBoxHeader.vue	Thu Mar 07 20:03:43 2019 +0100
+++ b/client/src/components/ui/UIBoxHeader.vue	Fri Mar 08 08:50:47 2019 +0100
@@ -9,9 +9,14 @@
       />
       {{ $gettext(title) }}
     </span>
-    <span class="box-close" @click="closeCallback" v-if="closeCallback">
-      <font-awesome-icon icon="times" />
-    </span>
+    <div class="box-controls">
+      <span @click="collapseCallback" v-if="collapseCallback">
+        <font-awesome-icon icon="angle-down" />
+      </span>
+      <span @click="closeCallback" v-if="closeCallback">
+        <font-awesome-icon icon="times" />
+      </span>
+    </div>
   </h6>
 </template>
 
@@ -20,7 +25,7 @@
   display: flex
   justify-content: space-between
   align-items: center
-  min-height: 35px
+  min-height: 34px
   padding-left: .5rem
   border-bottom: 1px solid #dee2e6
   color: $color-info
@@ -31,15 +36,18 @@
     padding-left: 0.25rem
     .box-icon
       margin-right: 0.25rem
-  .box-close
-    color: #888
-    padding: 3px 7px
-    border-radius: 0.25rem
-    cursor: pointer
-    transition: background-color 0.3s, color 0.3s
-    &:hover
-      color: #666
-      background-color: #eee
+  .box-controls
+    span
+      display: inline-block
+      margin-left: 3px
+      color: #888
+      padding: 3px 7px
+      border-radius: 0.25rem
+      cursor: pointer
+      transition: background-color 0.3s, color 0.3s
+      &:hover
+        color: #666
+        background-color: #eee
 </style>
 
 <script>
@@ -58,6 +66,6 @@
  */
 
 export default {
-  props: ["icon", "title", "closeCallback"]
+  props: ["icon", "title", "collapseCallback", "closeCallback"]
 };
 </script>