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

Custom accordion for inflection table

parent d063221a
No related branches found
No related tags found
No related merge requests found
...@@ -30,13 +30,21 @@ ...@@ -30,13 +30,21 @@
<v-btn depressed small class="toolbar-button" rounded tabindex="0" @click="shareViaWebShare"> <v-btn depressed small class="toolbar-button" rounded tabindex="0" @click="shareViaWebShare">
<v-icon small>format_quote</v-icon> <v-icon small>format_quote</v-icon>
</v-btn>--> </v-btn>-->
<v-btn class="show-inflection" rounded depressed small >Vis bøying &nbsp;&#9662;</v-btn>
<div v-if="inflected">
<v-btn class="show-inflection" rounded depressed small @click.native="toggle" :class="$vuetify.breakpoint.name">
<span v-bind:class="[{open:inflection_expanded}, dictionary]">bøyning</span>
</v-btn>
<div class="inflection-canvas" v-if="inflection_expanded">
<inflectionTable :lemmaList="lemmas_with_word_class_and_lang" :mq="$vuetify.breakpoint.name" />
</div>
</div>
<!-- <!--
<details :title="inflect_tooltip" @toggle="toggle()" v-if="inflected" :class="$vuetify.breakpoint.name"> <details :title="inflect_tooltip" @toggle="toggle()" v-if="inflected" :class="$vuetify.breakpoint.name">
<summary :class="dictionary" onclick="this.blur()" tabindex="0">bøying</summary> <summary :class="dictionary" onclick="this.blur()" tabindex="0">bøying</summary>
<div class="inflection-canvas">
<inflectionTable :lemmaList="lemmas_with_word_class_and_lang" :mq="$vuetify.breakpoint.name" />
</div>
</details>--> </details>-->
</div> </div>
...@@ -114,15 +122,19 @@ export default { ...@@ -114,15 +122,19 @@ export default {
data: function() { data: function() {
return { return {
inflect_reported: false, inflect_reported: false,
menu: false menu: false,
inflection_expanded: false
} }
}, },
methods: { methods: {
toggle: function() { toggle: function() {
this.inflection_expanded = !this.inflection_expanded
console.log(this.inflection_expanded)
if (! this.inflect_reported) { if (! this.inflect_reported) {
this.$plausible.trackEvent('open inflection', {props: {article: `/${this.dictionary}/${this.article_id}/${this.lemmas[0].lemma}`}}) this.$plausible.trackEvent('open inflection', {props: {article: `/${this.dictionary}/${this.article_id}/${this.lemmas[0].lemma}`}})
} }
this.inflect_reported = true this.inflect_reported = true
} }
} }
} }
...@@ -207,36 +219,37 @@ article h2.secondary_header { ...@@ -207,36 +219,37 @@ article h2.secondary_header {
box-shadow: 2px 2px 0px var(--v-primary-base) box-shadow: 2px 2px 0px var(--v-primary-base)
} }
.header details > summary:after {
content: "⌄";
font-weight: bold;
position: absolute;
right: 0;
top: 1px;
margin-right: 3px;
}
.header details > summary.bob:before { .show-inflection .bob:before {
content: "Se "; content: "Se ";
} }
.header details > summary.nob:before { .show-inflection .nob:before {
content: "Sjå "; content: "Sjå ";
} }
.header details[open] > summary.bob:before, details[open] > summary.nob:before { .show-inflection .open.bob:before, .show-inflection .open.nob:before {
content: "Skjul "; content: "Skjul ";
} }
.header details[open] > summary:after { .show-inflection .bob:after, .show-inflection .nob:after {
content: ""; content: "";
font-weight: bold; font-weight: bold;
position: absolute;
right: 0; right: 0;
top: 8px; top: 8px;
margin-right: 3px; margin-left: 6px;;
}
.show-inflection .open:after {
content: "▴";
font-weight: bold;
right: 0;
top: 1px;
margin-left: 6px;
} }
@keyframes open { @keyframes open {
0% { 0% {
opacity: 0; opacity: 0;
...@@ -264,9 +277,10 @@ article h2.secondary_header { ...@@ -264,9 +277,10 @@ article h2.secondary_header {
} }
.infl-wrapper { .infl-wrapper {
color: var(--v-primary-base); color: var(--v-text-base);
width: min-content; width: min-content;
font-size: 14px; font-size: 14px;
overflow-x: auto;
} }
.show-inflection { .show-inflection {
...@@ -294,8 +308,8 @@ th, td { ...@@ -294,8 +308,8 @@ th, td {
} }
th { th {
background-color: var(--v-tertiary-darken1); background-color: var(--v-button-base);
color: var(--v-primary-darken1); color: var(--v-primary-darken1)
} }
.infl-label { .infl-label {
......
...@@ -59,6 +59,7 @@ export default new Vuetify({ ...@@ -59,6 +59,7 @@ export default new Vuetify({
anchor: '#880E4F', anchor: '#880E4F',
error: '#FDF4F5', error: '#FDF4F5',
border: '#9E9E9E', border: '#9E9E9E',
button: '#f5f5f5',
text: '#000000' text: '#000000'
} }
} }
......
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