Mercurial > gemma
annotate client/src/components/DiagramLegend.vue @ 2920:c1f2b9148cc8
client: removed more unnecessary closing tags and opzimized imports
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 03 Apr 2019 16:23:25 +0200 |
parents | 451d73940c81 |
children | 7d33eff62dc6 |
rev | line source |
---|---|
2837
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
2839
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
2 <div :class="['d-flex border-right', { collapsed }]" id="diagram-legend"> |
2837
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
3 <span class="box-control toggle" @click="collapsed = !collapsed"> |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
4 <font-awesome-icon icon="angle-left" fixed-width /> |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
5 </span> |
2839
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
6 <div |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
7 class="d-flex align-items-center justify-content-center w-100" |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
8 style="overflow: hidden" |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
9 > |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
10 <div class="text-left"> |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
11 <slot /> |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
12 </div> |
2837
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
13 </div> |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
14 </div> |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
15 </template> |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
16 |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
17 <style lang="sass" scoped> |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 #diagram-legend |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 position: relative |
2843
451d73940c81
client: diagrams: more compact legend style, removed unnecessary legend items
Markus Kottlaender <markus@intevation.de>
parents:
2839
diff
changeset
|
20 width: 180px |
451d73940c81
client: diagrams: more compact legend style, removed unnecessary legend items
Markus Kottlaender <markus@intevation.de>
parents:
2839
diff
changeset
|
21 font-size: 0.8rem |
2837
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 .toggle |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
23 margin-left: 0 |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 position: absolute |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 top: 0.25rem |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 left: 0.25rem |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 svg |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 transition: transform 0.3s |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 &.collapsed |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 width: 0 |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 .toggle |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
32 left: 0.25rem |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
33 svg |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
34 transform: rotateY(180deg) |
2839
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
35 .legend |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
36 margin: 10px 0 |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
37 span |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
38 vertical-align: middle |
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
39 display: inline-block |
2843
451d73940c81
client: diagrams: more compact legend style, removed unnecessary legend items
Markus Kottlaender <markus@intevation.de>
parents:
2839
diff
changeset
|
40 width: 12px |
451d73940c81
client: diagrams: more compact legend style, removed unnecessary legend items
Markus Kottlaender <markus@intevation.de>
parents:
2839
diff
changeset
|
41 height: 12px |
2839
162804509c3e
client: spuc7/8: added legends
Markus Kottlaender <markus@intevation.de>
parents:
2837
diff
changeset
|
42 border-radius: 50% |
2837
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
43 </style> |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
44 |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
45 <script> |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
46 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
47 * without warranty, see README.md and license for details. |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
48 * |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
49 * SPDX-License-Identifier: AGPL-3.0-or-later |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 * License-Filename: LICENSES/AGPL-3.0.txt |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 * |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
52 * Copyright (C) 2018 by via donau |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
53 * – Österreichische Wasserstraßen-Gesellschaft mbH |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
54 * Software engineering by Intevation GmbH |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 * |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 * Author(s): |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
57 * Markus Kottländer <markus.kottlaender@intevation.de> |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 */ |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
60 export default { |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
61 data() { |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
62 return { |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
63 collapsed: false |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
64 }; |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
65 }, |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
66 watch: { |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
67 collapsed() { |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
68 this.$nextTick(this.$parent.drawDiagram); |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
69 } |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
70 } |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
71 }; |
61aacfd02812
client: added collapsible legend component for diagrams
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
72 </script> |