Mercurial > gemma
annotate client/src/components/systemconfiguration/MorphologyClassbreaks.vue @ 3937:de4c557bbc47
hydrological_conditions: leverage mixin
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Fri, 12 Jul 2019 10:03:11 +0200 |
parents | 851c0ccba59b |
children | 5d6a4dd3efa1 |
rev | line source |
---|---|
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
3889
851c0ccba59b
client: configuration: separated sections in tabs
Markus Kottlaender <markus@intevation.de>
parents:
3867
diff
changeset
|
2 <div class="d-flex flex-column py-4"> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
3 <div class="px-3"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
4 <h6 class="font-weight-bold"><translate>Sounding Result</translate></h6> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
5 <div class="d-flex flex-wrap"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
6 <div |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 class="input-group mb-3 mr-2 classbreak" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
8 v-for="(value, i) in morphologyClassbreaks" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
9 :key="i" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
10 > |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
11 <div class="input-group-prepend"> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
12 <button |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
13 :class="[ |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
14 'btn btn-sm btn-outline-secondary', |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
15 { hasColor: morphologyClassbreaks[i][1] !== '#ffffff' } |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
16 ]" |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
17 :style=" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
18 'width: 28px; background-color: ' + |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
19 (morphologyClassbreaks[i][1] || 'transparent') |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
20 " |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
21 type="button" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
22 @click="showColorPicker('sounding-' + i)" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
23 > |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
24 <font-awesome-icon icon="tint" /> |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
25 </button> |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
26 <div |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
27 class="color-picker card shadow-sm" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
28 v-if="activeColorPicker === 'sounding-' + i" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
29 > |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
30 <UIBoxHeader |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
31 :title="colorPickerTitle" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
32 icon="paint-brush" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
33 :actions="[ |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
34 { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
35 callback: () => { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
36 morphologyClassbreaks[i][1] = '#ffffff'; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
37 activeColorPicker = null; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
38 }, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
39 icon: 'trash' |
3859
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
40 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
41 { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
42 callback: () => { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
43 activeColorPicker = null; |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
44 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
45 icon: 'check' |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
46 } |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
47 ]" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
48 /> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
49 <chrome-picker |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
50 v-model="morphologyClassbreaks[i][1]" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
51 @input="color => (morphologyClassbreaks[i][1] = color.hex)" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
52 /> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
53 </div> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
54 </div> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 <input |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
56 v-model="morphologyClassbreaks[i][0]" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
57 type="number" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
58 min="0" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
59 step="0.1" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
60 class="form-control form-control-sm" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
61 /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
62 <div class="input-group-append"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
63 <button |
3612
c48b1e0fccd0
client: configuration: morphology: changed delete button color, to be less flashy
Markus Kottlaender <markus@intevation.de>
parents:
3611
diff
changeset
|
64 class="btn btn-sm btn-outline-secondary" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
65 type="button" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
66 @click="morphologyClassbreaks.splice(i, 1)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
67 > |
3614
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
68 <font-awesome-icon icon="times" /> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
69 </button> |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
70 <button |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
71 class="btn btn-sm btn-outline-secondary" |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
72 @click="addClassbreak(morphologyClassbreaks, i)" |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
73 > |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
74 <font-awesome-icon icon="plus" /> |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
75 </button> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
76 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
77 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
78 <button |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
79 v-if="!morphologyClassbreaks.length" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
80 class="btn btn-sm btn-success mb-3" |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
81 @click="addClassbreak(morphologyClassbreaks, 0)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
82 > |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
83 <font-awesome-icon icon="plus" /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
84 </button> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
85 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 </div> |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
87 <div class="mb-4 px-3"> |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
88 <a |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
89 @click.prevent="submitClassbreaks" |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
90 class="btn btn-info btn-sm text-white" |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
91 > |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
92 <translate>Send</translate> |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
93 </a> |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
94 <a |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
95 @click.prevent="resetClassbreaks" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
96 class="btn btn-outline-info btn-sm ml-2" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
97 > |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
98 <translate>Reset to defaults</translate> |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
99 </a> |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
100 </div> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
101 <div class="px-3"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
102 <h6 class="font-weight-bold"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 <translate>Sounding Result Comparison</translate> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
104 </h6> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
105 <div class="d-flex flex-wrap"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
106 <div |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 class="input-group mb-3 mr-2 classbreak" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
108 v-for="(value, i) in morphologyClassbreaksCompare" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
109 :key="i" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 > |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
111 <div class="input-group-prepend"> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
112 <button |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
113 :class="[ |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
114 'btn btn-sm btn-outline-secondary', |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
115 { hasColor: morphologyClassbreaksCompare[i][1] !== '#ffffff' } |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
116 ]" |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
117 :style=" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
118 'width: 28px; background-color: ' + |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
119 (morphologyClassbreaksCompare[i][1] || 'transparent') |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
120 " |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
121 type="button" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
122 @click="showColorPicker('compare-' + i)" |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
123 > |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
124 <font-awesome-icon icon="tint" /> |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
125 </button> |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
126 <div |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
127 class="color-picker card shadow-sm" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
128 v-if="activeColorPicker === 'compare-' + i" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
129 > |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
130 <UIBoxHeader |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
131 :title="colorPickerTitle" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
132 icon="paint-brush" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
133 :actions="[ |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
134 { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
135 callback: () => { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
136 morphologyClassbreaksCompare[i][1] = '#ffffff'; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
137 activeColorPicker = null; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
138 }, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
139 icon: 'trash' |
3859
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
140 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
141 { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
142 callback: () => { |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
143 activeColorPicker = null; |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
144 }, |
d1901366676a
client: configuration: replaced icon to close colorpicker for classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3856
diff
changeset
|
145 icon: 'check' |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
146 } |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
147 ]" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
148 /> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
149 <chrome-picker |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
150 v-model="morphologyClassbreaksCompare[i][1]" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
151 @input=" |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
152 color => (morphologyClassbreaksCompare[i][1] = color.hex) |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
153 " |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
154 /> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
155 </div> |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
156 </div> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
157 <input |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
158 v-model="morphologyClassbreaksCompare[i][0]" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
159 type="number" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
160 step="0.1" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
161 class="form-control form-control-sm" |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
162 /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
163 <div class="input-group-append"> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
164 <button |
3612
c48b1e0fccd0
client: configuration: morphology: changed delete button color, to be less flashy
Markus Kottlaender <markus@intevation.de>
parents:
3611
diff
changeset
|
165 class="btn btn-sm btn-outline-secondary" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
166 type="button" |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
167 @click="morphologyClassbreaksCompare.splice(i, 1)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
168 > |
3614
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
169 <font-awesome-icon icon="times" /> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
170 </button> |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
171 <button |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
172 class="btn btn-sm btn-outline-secondary" |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
173 @click="addClassbreak(morphologyClassbreaksCompare, i)" |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
174 > |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
175 <font-awesome-icon icon="plus" /> |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
176 </button> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
177 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
179 <button |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
180 v-if="!morphologyClassbreaksCompare.length" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
181 class="btn btn-sm btn-success mb-3" |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
182 @click="addClassbreak(morphologyClassbreaksCompare, 0)" |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
183 > |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
184 <font-awesome-icon icon="plus" /> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
185 </button> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
186 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 </div> |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
188 <div class="px-3"> |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
189 <a |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
190 @click.prevent="submitClassbreaksCompare" |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
191 class="btn btn-info btn-sm text-white" |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
192 > |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
193 <translate>Send</translate> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 </a> |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
195 <a |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
196 @click.prevent="resetClassbreaksCompare" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
197 class="btn btn-outline-info btn-sm ml-2" |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
198 > |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
199 <translate>Reset to defaults</translate> |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
200 </a> |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
201 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
202 </div> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
203 </template> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
204 |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
205 <style lang="sass" scoped> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
206 .classbreak |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
207 width: 142px |
3614
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
208 .btn-outline-secondary |
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
209 border-color: #ccc |
2055b689be54
client: configuration: morphology: even less flashy delete button style
Markus Kottlaender <markus@intevation.de>
parents:
3612
diff
changeset
|
210 color: #ccc |
3856
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
211 &:hover:not(.hasColor) |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
212 background: #eee !important |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
213 .input-group-prepend |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
214 .btn-outline-secondary.hasColor |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
215 color: rgba(255, 255, 255, 0.5) |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
216 .input-group-append |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
217 .btn-outline-secondary |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
218 &:hover |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
219 color: #dc3545 |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
220 &:last-child:hover |
0b8b62fd8cea
client: configuration: added tint icon to classbreak color selection
Markus Kottlaender <markus@intevation.de>
parents:
3855
diff
changeset
|
221 color: #28a745 |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
222 .color-picker |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
223 position: absolute |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
224 top: -4px |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
225 left: 19px |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
226 z-index: 9 |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
227 overflow: hidden |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
228 border-top-left-radius: 0 !important |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
229 .btn |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
230 border-radius: 0 !important |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
231 .vc-chrome |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
232 box-shadow: none |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
233 /deep/ |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
234 .vc-chrome-alpha-wrap |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
235 display: none !important |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
236 .vc-chrome-hue-wrap |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
237 margin-top: 10px |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
238 .vc-chrome-saturation-wrap |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
239 border-radius: 0 |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
240 </style> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
241 |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
242 <script> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
243 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
244 * without warranty, see README.md and license for details. |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
245 * |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
246 * SPDX-License-Identifier: AGPL-3.0-or-later |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
247 * License-Filename: LICENSES/AGPL-3.0.txt |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
248 * |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
249 * Copyright (C) 2018 by via donau |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
250 * – Österreichische Wasserstraßen-Gesellschaft mbH |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
251 * Software engineering by Intevation GmbH |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
252 * |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
253 * Author(s): |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
254 * Markus Kottländer <markus@intevation.de> |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
255 */ |
3622
30a9fdac70f0
client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents:
3614
diff
changeset
|
256 import { mapState } from "vuex"; |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
257 import { Chrome } from "vue-color"; |
3867
d37f44c4d531
client: configuration: moved default values to separate file
Markus Kottlaender <markus@intevation.de>
parents:
3861
diff
changeset
|
258 import defaults from "./defaults"; |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
259 |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
260 export default { |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
261 components: { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
262 "chrome-picker": Chrome |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
263 }, |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
264 data() { |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
265 return { |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
266 morphologyClassbreaks: [], |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
267 morphologyClassbreaksCompare: [], |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
268 activeColorPicker: null, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
269 closeColorPickerListener: null |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
270 }; |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
271 }, |
3622
30a9fdac70f0
client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents:
3614
diff
changeset
|
272 computed: { |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
273 ...mapState("application", ["config"]), |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
274 colorPickerTitle() { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
275 return this.$gettext("Choose color"); |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
276 } |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
277 }, |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
278 methods: { |
3855
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
279 addClassbreak(classbreaks, i) { |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
280 classbreaks.splice( |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
281 i, |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
282 0, |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
283 classbreaks.length > i |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
284 ? [classbreaks[i][0], classbreaks[i][1]] // create new array! |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
285 : [1, "#ffffff"] |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
286 ); |
4a2a778f35da
client: configuration: classbreaks: fixed databinding issue and added possibility to add classbreaks at any position
Markus Kottlaender <markus@intevation.de>
parents:
3850
diff
changeset
|
287 }, |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
288 showColorPicker(id) { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
289 this.activeColorPicker = this.activeColorPicker === id ? null : id; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
290 }, |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
291 submitClassbreaks() { |
3850
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
292 this.$store |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
293 .dispatch("application/saveConfig", { |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
294 morphology_classbreaks: this.morphologyClassbreaks |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
295 .map(cb => (cb[1] === "#ffffff" ? cb[0] : cb.join(":"))) |
3860
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
296 .join(",") |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
297 }) |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
298 .finally(() => this.$store.dispatch("application/loadConfig")); |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
299 }, |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
300 submitClassbreaksCompare() { |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
301 this.$store |
9a7a27301720
client: configuration: save sounding result classbreaks and comparison classbreaks separately
Markus Kottlaender <markus@intevation.de>
parents:
3859
diff
changeset
|
302 .dispatch("application/saveConfig", { |
3850
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
303 morphology_classbreaks_compare: this.morphologyClassbreaksCompare |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
304 .map(cb => (cb[1] === "#ffffff" ? cb[0] : cb.join(":"))) |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
305 .join(",") |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
306 }) |
0d0e52612c32
client: reload config right after saving it to make sure everything is updated
Markus Kottlaender <markus@intevation.de>
parents:
3763
diff
changeset
|
307 .finally(() => this.$store.dispatch("application/loadConfig")); |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
308 }, |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
309 resetClassbreaks() { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
310 this.morphologyClassbreaks = this.parseClassbreakString( |
3867
d37f44c4d531
client: configuration: moved default values to separate file
Markus Kottlaender <markus@intevation.de>
parents:
3861
diff
changeset
|
311 defaults.morphology_classbreaks |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
312 ); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
313 }, |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
314 resetClassbreaksCompare() { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
315 this.morphologyClassbreaksCompare = this.parseClassbreakString( |
3867
d37f44c4d531
client: configuration: moved default values to separate file
Markus Kottlaender <markus@intevation.de>
parents:
3861
diff
changeset
|
316 defaults.morphology_classbreaks_compare |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
317 ); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
318 }, |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
319 parseClassbreakString(str) { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
320 return str |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
321 .split(",") |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
322 .map(cb => cb.split(":")) |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
323 .map(cb => { |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
324 cb[0] = Number(cb[0]); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
325 cb[1] = cb[1] || "#ffffff"; |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
326 return cb; |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
327 }); |
3622
30a9fdac70f0
client: configuration: prepared fetching morphology classbreaks and ecdis url from backend
Markus Kottlaender <markus@intevation.de>
parents:
3614
diff
changeset
|
328 } |
3625
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
329 }, |
a688a478e35f
implemented configuration backend and frontend
Markus Kottlaender <markus@intevation.de>
parents:
3622
diff
changeset
|
330 mounted() { |
3861
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
331 this.morphologyClassbreaks = this.parseClassbreakString( |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
332 this.config.morphology_classbreaks |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
333 ); |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
334 this.morphologyClassbreaksCompare = this.parseClassbreakString( |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
335 this.config.morphology_classbreaks_compare |
704f853b9c37
client: configuration: reset morphology classbreaks
Markus Kottlaender <markus@intevation.de>
parents:
3860
diff
changeset
|
336 ); |
3763
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
337 |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
338 this.closeColorPickerListener = e => { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
339 // Escape |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
340 if (e.keyCode === 27) { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
341 this.activeColorPicker = null; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
342 } |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
343 }; |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
344 window.addEventListener("keydown", this.closeColorPickerListener); |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
345 }, |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
346 destroyed() { |
a1bb7c894058
client: configuration: morphology classbreaks: added color selection
Markus Kottlaender <markus@intevation.de>
parents:
3625
diff
changeset
|
347 window.removeEventListener("keydown", this.closeColorPickerListener); |
3606
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
348 } |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
349 }; |
a8190a570b71
client: configuration: prepared morphology classbreaks UI
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
350 </script> |