Commit 139220aa authored by schneider210's avatar schneider210
Browse files

feat: in- or decrease the fontsize in the text panel on click

parent 2b3d2218
Pipeline #204510 passed with stages
in 4 minutes and 29 seconds
......@@ -58,7 +58,7 @@ export default {
config: {},
contentTypes: [],
contentUrls: [],
fontsize: 14,
fontsize: 1,
imageurl: '',
isCollection: false,
item: {},
......@@ -394,6 +394,7 @@ export default {
display: flex;
flex: 1;
flex-direction: column;
font-size: 1em;
overflow: hidden;
}
......
......@@ -80,7 +80,7 @@ export default {
},
fontsize: {
type: Number,
default: () => 14,
default: () => 1,
},
manifests: {
type: Array,
......@@ -110,7 +110,7 @@ export default {
watch: {
fontsize() {
this.$refs.contentsize.style.fontSize = `${this.fontsize}px`;
this.$refs.contentsize.style.fontSize = `${this.fontsize}em`;
},
async activeTab(url) {
const data = await this.request(url, 'text');
......@@ -134,7 +134,7 @@ export default {
},
mounted() {
this.$refs.contentsize.style.fontSize = `${this.fontsize}px`;
this.$refs.contentsize.style.fontSize = `${this.fontsize}em`;
this.$root.$on('update-sequence-index', (index) => {
if (this.supportType) {
......@@ -144,17 +144,21 @@ export default {
},
methods: {
decrease() {
const min = 8;
const min = 0.875;
let textsize = this.fontsize;
textsize -= textsize > min ? 1 : 0;
textsize -= textsize > min ? 0.125 : 0;
if (textsize < min) textsize = min;
this.$root.$emit('update-fontsize', textsize);
},
increase() {
const max = 32;
const max = 1.5;
let textsize = this.fontsize;
textsize += textsize < max ? 1 : 0;
textsize += textsize < max ? 0.125 : 0;
if (textsize > max) textsize = max;
this.$root.$emit('update-fontsize', textsize);
},
getSupport(support) {
......
......@@ -31,7 +31,7 @@
-->
<script id="tido-config" type="application/json">
{
"entrypoint": "",
"entrypoint": "https://ahikar-dev.sub.uni-goettingen.de/api/textapi/ahikar/syriac/collection.json",
"annotations": {
"show": true,
"types": [
......
......@@ -107,7 +107,7 @@ export default {
},
fontsize: {
type: Number,
default: () => 14,
default: () => 1,
},
imageurl: {
type: String,
......
Markdown is supported
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