Mercurial > gemma
annotate client/src/components/ui/UISpinnerButton.vue @ 3678:8f58851927c0
client: make layer factory only return new layer config for individual maps
instead of each time it is invoked. The purpose of the factory was to support multiple maps with individual layers.
But returning a new config each time it is invoked leads to bugs that rely on the layer's state. Now this factory
reuses the same objects it created before, per map.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Mon, 17 Jun 2019 17:31:35 +0200 |
parents | b22f84d312f2 |
children |
rev | line source |
---|---|
2898
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
2918
b22f84d312f2
client: ui: removed animation from spinner button
Markus Kottlaender <markus@intevation.de>
parents:
2898
diff
changeset
|
2 <div :class="classesString" @click="$emit('click')"> |
b22f84d312f2
client: ui: removed animation from spinner button
Markus Kottlaender <markus@intevation.de>
parents:
2898
diff
changeset
|
3 <font-awesome-icon :icon="iconString" :spin="loading" fixed-width /> |
b22f84d312f2
client: ui: removed animation from spinner button
Markus Kottlaender <markus@intevation.de>
parents:
2898
diff
changeset
|
4 <slot /> |
b22f84d312f2
client: ui: removed animation from spinner button
Markus Kottlaender <markus@intevation.de>
parents:
2898
diff
changeset
|
5 </div> |
2898
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
6 </template> |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
7 |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
8 <script> |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
9 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
10 * without warranty, see README.md and license for details. |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
11 * |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
12 * SPDX-License-Identifier: AGPL-3.0-or-later |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
13 * License-Filename: LICENSES/AGPL-3.0.txt |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
14 * |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
15 * Copyright (C) 2018 by via donau |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
16 * – Österreichische Wasserstraßen-Gesellschaft mbH |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
17 * Software engineering by Intevation GmbH |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
18 * |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
19 * Author(s): |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
20 * Markus Kottländer <markus.kottlaender@intevation.de> |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
21 */ |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
22 export default { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
23 props: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
24 loading: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
25 type: Boolean, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
26 default: false |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
27 }, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
28 state: [Number, Boolean], |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
29 icons: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
30 type: [String, Array], |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
31 default: () => ["angle-down", "angle-up"] |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
32 }, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
33 classes: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
34 type: [String, Array], |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
35 default: () => ["text-info", "text-white"] |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
36 } |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
37 }, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
38 computed: { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
39 classesString() { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
40 return ( |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
41 "pointer " + |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
42 (Array.isArray(this.classes) |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
43 ? this.classes[Number(this.state)] |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
44 : this.classes) |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
45 ); |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
46 }, |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
47 iconString() { |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
48 return this.loading |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
49 ? "spinner" |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
50 : Array.isArray(this.icons) |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
51 ? this.icons[Number(this.state)] |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
52 : this.icons; |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
53 } |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
54 } |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
55 }; |
d57c951aec65
client: added spinner button component
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
56 </script> |