aboutsummaryrefslogtreecommitdiff
path: root/src/components/opacity_input/opacity_input.vue
diff options
context:
space:
mode:
authorHJ <spam@hjkos.com>2018-12-11 20:35:19 +0000
committerHJ <spam@hjkos.com>2018-12-11 20:35:19 +0000
commita8acba8cb2c639a3de3764df4226960458f996b8 (patch)
tree50c4d353576cc419eeea4f45c4497309222cf360 /src/components/opacity_input/opacity_input.vue
parentfb5261b926adfb5b9bbe1bf55e36fe8b5f4eb57f (diff)
parent8fcc4c67667b0951d6c0d28cec320bd4b2f8f107 (diff)
Merge branch 'feature/theming2' into 'develop'
Themes v2 See merge request pleroma/pleroma-fe!377
Diffstat (limited to 'src/components/opacity_input/opacity_input.vue')
-rw-r--r--src/components/opacity_input/opacity_input.vue38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/components/opacity_input/opacity_input.vue b/src/components/opacity_input/opacity_input.vue
new file mode 100644
index 00000000..3926915b
--- /dev/null
+++ b/src/components/opacity_input/opacity_input.vue
@@ -0,0 +1,38 @@
+<template>
+<div class="opacity-control style-control" :class="{ disabled: !present || disabled }">
+ <label :for="name" class="label">
+ {{$t('settings.style.common.opacity')}}
+ </label>
+ <input
+ v-if="typeof fallback !== 'undefined'"
+ class="opt exclude-disabled"
+ :id="name + '-o'"
+ type="checkbox"
+ :checked="present"
+ @input="$emit('input', !present ? fallback : undefined)">
+ <label v-if="typeof fallback !== 'undefined'" class="opt-l" :for="name + '-o'"></label>
+ <input
+ :id="name"
+ class="input-number"
+ type="number"
+ :value="value || fallback"
+ :disabled="!present || disabled"
+ @input="$emit('input', $event.target.value)"
+ max="1"
+ min="0"
+ step=".05">
+</div>
+</template>
+
+<script>
+export default {
+ props: [
+ 'name', 'value', 'fallback', 'disabled'
+ ],
+ computed: {
+ present () {
+ return typeof this.value !== 'undefined'
+ }
+ }
+}
+</script>