Commit 721bfa78 authored by schneider210's avatar schneider210
Browse files

feat: change the fontsize consistently by percentage

parent 80460e29
Pipeline #186805 failed with stages
in 9 minutes and 50 seconds
......@@ -62,7 +62,7 @@ export default {
config: {},
contentTypes: [],
contenturls: [],
fontsize: 14,
fontsize: 100,
imageurl: '',
isCollection: false,
item: {},
......@@ -89,7 +89,7 @@ export default {
/**
* listen to fontsize change (user interaction). emitted in @/components/content.vue
* in- or rather decrease fontsize of the text by 1px
* default fontsize: 14px
* default fontsize: 100%
*
* @param number fontsize
*/
......
......@@ -81,7 +81,7 @@ export default {
},
fontsize: {
type: Number,
default: () => 14,
default: () => null,
},
manifests: {
type: Array,
......@@ -111,7 +111,7 @@ export default {
watch: {
fontsize() {
this.$refs.contentsize.style.fontSize = `${this.fontsize}px`;
this.$refs.contentsize.style.fontSize = `${this.fontsize}%`;
},
activeTab(url) {
this.request(url, 'text').then((data) => {
......@@ -133,7 +133,7 @@ export default {
},
mounted() {
this.$refs.contentsize.style.fontSize = `${this.fontsize}px`;
this.$refs.contentsize.style.fontSize = `${this.fontsize}%`;
this.$root.$on('update-sequence-index', (index) => {
if (this.supportType) {
......@@ -143,17 +143,17 @@ export default {
},
methods: {
decrease() {
const min = 8;
const min = 90;
let textsize = this.fontsize;
textsize -= textsize > min ? 1 : 0;
textsize -= textsize > min ? 10 : 0;
this.$root.$emit('update-fontsize', textsize);
},
increase() {
const max = 32;
const max = 150;
let textsize = this.fontsize;
textsize += textsize < max ? 1 : 0;
textsize += textsize < max ? 10 : 0;
this.$root.$emit('update-fontsize', textsize);
},
getSupport(support) {
......
......@@ -99,7 +99,7 @@ export default {
},
fontsize: {
type: Number,
default: () => 14,
default: () => 100,
},
imageurl: {
type: String,
......
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