annotate client/src/components/Contextbox.vue @ 3263:d23532a4d0c3

client: define stretches: renamed component file and moved to subdirectory as preparation for splitting list and edit view into separate components and then duplicating for sections
author Markus Kottlaender <markus@intevation.de>
date Wed, 15 May 2019 12:04:14 +0200
parents a2e9671f4ad6
children ec27ee21f7bc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
1 <template>
1362
ca33ad696594 remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
2 <div :class="style">
3262
a2e9671f4ad6 client: removed closing html tags
Markus Kottlaender <markus@intevation.de>
parents: 3261
diff changeset
3 <Bottlenecks v-if="contextBoxContent === 'bottlenecks'" />
a2e9671f4ad6 client: removed closing html tags
Markus Kottlaender <markus@intevation.de>
parents: 3261
diff changeset
4 <Staging v-if="contextBoxContent === 'staging'" />
a2e9671f4ad6 client: removed closing html tags
Markus Kottlaender <markus@intevation.de>
parents: 3261
diff changeset
5 <Stretches v-if="contextBoxContent === 'stretches'" />
a2e9671f4ad6 client: removed closing html tags
Markus Kottlaender <markus@intevation.de>
parents: 3261
diff changeset
6 <ImportOverview v-if="contextBoxContent === 'importoverview'" />
a2e9671f4ad6 client: removed closing html tags
Markus Kottlaender <markus@intevation.de>
parents: 3261
diff changeset
7 <ImportConfiguration v-if="contextBoxContent === 'importconfiguration'" />
1362
ca33ad696594 remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
8 </div>
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
9 </template>
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
10
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
11 <script>
1362
ca33ad696594 remove the first empyty lines
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1299
diff changeset
12 /* This is Free Software under GNU Affero General Public License v >= 3.0
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
13 * without warranty, see README.md and license for details.
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
14 *
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
15 * SPDX-License-Identifier: AGPL-3.0-or-later
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
16 * License-Filename: LICENSES/AGPL-3.0.txt
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
17 *
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
18 * Copyright (C) 2018 by via donau
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
19 * – Österreichische Wasserstraßen-Gesellschaft mbH
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
20 * Software engineering by Intevation GmbH
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
21 *
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
22 * Author(s):
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
23 * Markus Kottländer <markus.kottlaender@intevation.de>
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
24 */
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
25 import { mapState } from "vuex";
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
26
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
27 export default {
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
28 name: "contextbox",
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
29 components: {
2399
Thomas Junk <thomas.junk@intevation.de>
parents: 2387
diff changeset
30 Bottlenecks: () => import("@/components/Bottlenecks"),
3263
d23532a4d0c3 client: define stretches: renamed component file and moved to subdirectory
Markus Kottlaender <markus@intevation.de>
parents: 3262
diff changeset
31 Stretches: () => import("@/components/stretches/Stretches"),
2985
1b8bb4f89227 client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents: 2972
diff changeset
32 ImportOverview: () => import("@/components/importoverview/ImportOverview"),
1b8bb4f89227 client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents: 2972
diff changeset
33 ImportConfiguration: () => import("@/components/importconfiguration/Import")
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
34 },
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
35 computed: {
1282
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
36 ...mapState("application", [
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
37 "showSearchbarLastState",
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
38 "contextBoxContent",
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
39 "showContextBox"
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
40 ]),
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
41 style() {
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
42 return [
1282
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
43 "ui-element shadow-xs contextbox",
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
44 {
1282
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
45 contextboxcollapsed: !this.showContextBox,
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
46 contextboxextended: this.showContextBox,
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
47 "rounded-bottom": this.contextBoxContent !== "imports",
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
48 rounded: this.contextBoxContent === "imports"
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
49 }
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
50 ];
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
51 }
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
52 },
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
53 methods: {
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
54 close() {
3261
916d4c898f08 client: import stretches: prevent map/identify popup from opening when selecting a distance mark on the map
Markus Kottlaender <markus@intevation.de>
parents: 3012
diff changeset
55 this.$store.commit("map/mapPopupEnabled", true);
2282
2e40909a975d clean searchbar when context is changed
Thomas Junk <thomas.junk@intevation.de>
parents: 2154
diff changeset
56 this.$store.commit("application/searchQuery", "");
1282
a7dd8a3356fc fixed contextBox animations
Markus Kottlaender <markus@intevation.de>
parents: 1278
diff changeset
57 this.$store.commit("application/showContextBox", false);
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
58 this.$store.commit(
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
59 "application/showSearchbar",
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
60 this.showSearchbarLastState
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
61 );
2329
514193fd0120 refac: improve routing structure. We now have /bottlenecks, /stretches, /review routes
Thomas Junk <thomas.junk@intevation.de>
parents: 2282
diff changeset
62 this.$router.push("/");
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
63 }
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
64 }
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
65 };
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
66 </script>
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
67
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
68 <style lang="scss" scoped>
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
69 .contextbox {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
70 position: relative;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
71 background-color: #ffffff;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
72 opacity: $slight-transparent;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
73 transition: max-width 0.3s, max-height 0.3s;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
74 overflow: hidden;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
75 background: #fff;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
76 }
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
77 .contextbox > div:last-child {
3012
802fcb50c484 search, contextbox: increased available area
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
78 width: 668px;
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
79 }
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
80
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
81 .contextboxcollapsed {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
82 max-width: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
83 max-height: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
84 }
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
85
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
86 .contextboxextended {
3012
802fcb50c484 search, contextbox: increased available area
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
87 max-width: 668px;
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
88 }
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
89
1449
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
90 .close-contextbox {
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
91 position: absolute;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
92 z-index: 2;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
93 right: 0;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
94 top: 7px;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
95 height: $icon-width;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
96 width: $icon-height;
bb47531bdd22 sass to scss
Thomas Junk <thomas.junk@intevation.de>
parents: 1403
diff changeset
97 }
1276
aec9ed491dad more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
98 </style>