aboutsummaryrefslogtreecommitdiff
path: root/src/components/opacity_input/opacity_input.vue
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2020-01-02 22:44:54 +0200
committerHenry Jameson <me@hjkos.com>2020-01-02 22:44:54 +0200
commitc7e9f21da0eb035b73a165e16f77a9cd18036305 (patch)
tree21bf4a0a373bb29065950e237730eb1c8c5666e9 /src/components/opacity_input/opacity_input.vue
parentadbab6ad2a413357b24edbd5b9beec3baae695fa (diff)
color input and opacity input now use Checkbox component. Cleanup.
Diffstat (limited to 'src/components/opacity_input/opacity_input.vue')
-rw-r--r--src/components/opacity_input/opacity_input.vue51
1 files changed, 10 insertions, 41 deletions
diff --git a/src/components/opacity_input/opacity_input.vue b/src/components/opacity_input/opacity_input.vue
index f7b10d30..cfda9926 100644
--- a/src/components/opacity_input/opacity_input.vue
+++ b/src/components/opacity_input/opacity_input.vue
@@ -9,18 +9,12 @@
>
{{ $t('settings.style.common.opacity') }}
</label>
- <input
+ <Checkbox
v-if="typeof fallback !== 'undefined'"
- :id="name + '-o'"
- class="opt exclude-disabled"
- type="checkbox"
:checked="present"
- @input="$emit('input', !present ? fallback : undefined)"
- >
- <label
- v-if="typeof fallback !== 'undefined' && showOptionalTickbox"
- class="opt-l"
- :for="name + '-o'"
+ :disabled="disabled"
+ @change="$emit('input', !present ? fallback : undefined)"
+ class="opt"
/>
<input
:id="name"
@@ -37,38 +31,13 @@
</template>
<script>
+import Checkbox from '../checkbox/checkbox.vue'
export default {
- props: {
- // Name of opacity, used for identifying
- name: {
- required: true,
- type: String
- },
- // Opacity value, should be required but vue cannot tell the difference
- // between "property missing" and "property set to undefined"
- value: {
- required: false,
- type: Number,
- default: undefined
- },
- // Opacity fallback to use when value is not defeind
- fallback: {
- required: false,
- type: Number,
- default: undefined
- },
- // Disable the control
- disabled: {
- required: false,
- type: Boolean,
- default: false
- },
- // Show "optional" tickbox, for when value might become mandatory
- showOptionalTickbox: {
- required: false,
- type: Boolean,
- default: true
- }
+ props: [
+ 'name', 'value', 'fallback', 'disabled'
+ ],
+ components: {
+ Checkbox
},
computed: {
present () {