annotate client/src/application/Linetool.vue @ 941:8a80ef09a62c

client: improve identify * Remove trigger that unfolds the box when features are identified. Rationale: This makes the user interface too "jumpy". * Instead add a style change for the icon to indicate if data is available. It will use the bootstrap `text-info` style class. * Simplify code that detects if a bottleneck was identified.
author Bernhard Reiter <bernhard@intevation.de>
date Tue, 09 Oct 2018 17:00:49 +0200
parents 2990a878b16b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
649
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 <template>
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2 <div @click="drawLine" class="ui-element d-flex shadow drawtool">
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 <i :class="icon"></i>
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
4 </div>
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
5 </template>
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
6
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 <style lang="scss">
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 .drawtool {
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9 position: absolute;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10 bottom: 0;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 right: 0;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
12 background-color: white;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
13 padding: $small-offset;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
14 border-radius: $border-radius;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 margin-left: $offset;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 height: $icon-width;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 width: $icon-height;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 margin-bottom: $offset;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 margin-right: $offset;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 z-index: 2;
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 }
752
f09cbe80a864 refac: small improvements
Thomas Junk <thomas.junk@intevation.de>
parents: 649
diff changeset
22
903
2990a878b16b fix cut with scissors
Thomas Junk <thomas.junk@intevation.de>
parents: 752
diff changeset
23 .inverted {
752
f09cbe80a864 refac: small improvements
Thomas Junk <thomas.junk@intevation.de>
parents: 649
diff changeset
24 color: #0077ff;
f09cbe80a864 refac: small improvements
Thomas Junk <thomas.junk@intevation.de>
parents: 649
diff changeset
25 }
649
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 </style>
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
27
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
28 <script>
903
2990a878b16b fix cut with scissors
Thomas Junk <thomas.junk@intevation.de>
parents: 752
diff changeset
29 import { mapGetters, mapState } from "vuex";
649
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
30
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
31 export default {
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
32 name: "linetool",
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
33 methods: {
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
34 drawLine() {
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
35 this.$store.commit("application/toggleDrawModeLine");
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
36 }
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
37 },
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
38 computed: {
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
39 ...mapGetters("application", ["drawMode"]),
903
2990a878b16b fix cut with scissors
Thomas Junk <thomas.junk@intevation.de>
parents: 752
diff changeset
40 ...mapState("mapstore", ["identifiedFeatures", "selectedMorph"]),
649
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
41 icon() {
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
42 return {
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
43 fa: true,
903
2990a878b16b fix cut with scissors
Thomas Junk <thomas.junk@intevation.de>
parents: 752
diff changeset
44 "fa-pencil": !this.selectedMorph,
2990a878b16b fix cut with scissors
Thomas Junk <thomas.junk@intevation.de>
parents: 752
diff changeset
45 "fa-pencil inverted": !this.selectedMorph && this.drawMode,
2990a878b16b fix cut with scissors
Thomas Junk <thomas.junk@intevation.de>
parents: 752
diff changeset
46 "fa-cut": this.selectedMorph,
2990a878b16b fix cut with scissors
Thomas Junk <thomas.junk@intevation.de>
parents: 752
diff changeset
47 "fa-cut inverted": this.selectedMorph && this.drawMode
649
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
48 };
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
49 }
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
50 }
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
51 };
83081ba6c9c1 feat: Linetool added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
52 </script>