Commit 5abadc59 authored by schneider210's avatar schneider210
Browse files

refactor: disable buttons whenever the fontsize exceeds the limits defined

pls refer to: https://gitlab.gwdg.de/subugoe/emo/Qviewer/-/merge_requests/188#note_341352
parent 2465db13
Pipeline #204584 passed with stages
in 4 minutes and 43 seconds
......@@ -24,6 +24,7 @@
flat
round
size="sm"
:disable="fontsize >= fontSizeLimits.max"
:title="$t('Increase')"
@click="increase()"
>
......@@ -39,6 +40,7 @@
flat
round
size="sm"
:disable="fontsize <= fontSizeLimits.min"
:title="$t('Decrease')"
:color="$q.dark.isActive ? 'white' : 'accent'"
@click="decrease()"
......@@ -98,6 +100,10 @@ export default {
data: () => ({
activeTab: null,
content: '',
fontSizeLimits: {
min: 14,
max: 24,
},
sequenceindex: 0,
}),
computed: {
......@@ -144,7 +150,7 @@ export default {
},
methods: {
decrease() {
const min = 14;
const { min } = this.fontSizeLimits;
let textsize = this.fontsize;
textsize -= textsize > min ? 2 : 0;
......@@ -153,7 +159,7 @@ export default {
this.$root.$emit('update-fontsize', textsize);
},
increase() {
const max = 24;
const { max } = this.fontSizeLimits;
let textsize = this.fontsize;
textsize += textsize < max ? 2 : 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment