Skip to content
Snippets Groups Projects
Commit 125f4e65 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

smaller font if overflow

parent dabbe180
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<div class = "header"> <div class = "header">
<h2> <h2>
<router-link tabindex="0" :id="title_id" :to="$parent.link_to_self.ref" @click.native="$parent.details_click($parent.link_to_self)" v-bind:class="{'long_lemma': long_lemma}" class="article_header"> <router-link tabindex="0" :id="title_id" :to="$parent.link_to_self.ref" @click.native="$parent.details_click($parent.link_to_self)" v-bind:class="{'long_lemma': long_lemma}" class="article_header">
<span v-for="(lemma, index) in lemmas" :key="index">{{lemma.lemma}}<span :aria-label="hgno_arabic" class="hgno" v-if="$store.state.showHGNO && hgno(lemma)">{{" "+hgno(lemma)}}</span><span class="title_comma" v-if="lemmas[1] && index < lemmas.length-1">{{", "}}</span> <span v-for="(lemma, index) in lemmas" :key="index">{{lemma.lemma}}<span :aria-label="hgno_arabic" class="hgno" v-if="$store.state.showHGNO && hgno(lemma)">{{" "+hgno(lemma)}}</span><span class="title_comma" v-if="lemmas[1] && index < lemmas.length-1">{{", "}}</span>
</span> </span>
</router-link></h2> </router-link></h2>
...@@ -48,6 +48,21 @@ export default { ...@@ -48,6 +48,21 @@ export default {
dictionary: String, dictionary: String,
article_id: Number, article_id: Number,
title_id: String title_id: String
},
data: function() {
return {
menu: false,
long_lemma: false
}
},
mounted: function() {
//console.log(this.$refs[this.title_id])
//console.log(document.getElementById(this.title_id).offsetWidth, document.getElementById(this.title_id).scrollWidth)
if (this.$el.scrollWidth > this.$el.offsetWidth) {
this.long_lemma = true
}
}, },
methods: { methods: {
hgno: function(lemma) { hgno: function(lemma) {
...@@ -59,13 +74,6 @@ export default { ...@@ -59,13 +74,6 @@ export default {
} }
}, },
computed: { computed: {
long_lemma: function(lemma) {
for (const lemma of this.lemmas) {
if (lemma.lemma.length > 18) return true
}
return false
},
secondary_header_text: function() { secondary_header_text: function() {
let a_forms = [] let a_forms = []
this.lemmas.forEach((lemma, i) => { this.lemmas.forEach((lemma, i) => {
...@@ -137,11 +145,6 @@ export default { ...@@ -137,11 +145,6 @@ export default {
split_inf: function() { split_inf: function() {
return this.lemmas[0].split_inf return this.lemmas[0].split_inf
} }
},
data: function() {
return {
menu: false,
}
} }
} }
...@@ -193,14 +196,11 @@ div.lemma { ...@@ -193,14 +196,11 @@ div.lemma {
.article_header { .article_header {
text-decoration: none; text-decoration: none;
overflow:auto; overflow:auto;
word-wrap: normal; word-wrap: normal;
white-space: wrap;
overflow: auto;
} }
.long_lemma { .long_lemma {
font-size: 22px !important; font-size: 60% !important;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment