From def84689bd33fbc972ed69517d333ebc1a480d20 Mon Sep 17 00:00:00 2001 From: Petr Kalashnikov <pka065@it6100016.klientdrift.uib.no> Date: Mon, 9 Aug 2021 15:58:53 +0200 Subject: [PATCH] Move article reference line --- src/components/Definition.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/Definition.vue b/src/components/Definition.vue index 3c6b0f7..dda93c4 100644 --- a/src/components/Definition.vue +++ b/src/components/Definition.vue @@ -1,7 +1,7 @@ <template> <li :class="['definition', 'level'+level]" :ref="'def' + body.id" :id="'def' + body.id"> <ul class="explanations"> - <DefElement :body="explanation" :dictionary="dictionary" v-for="(explanation, index) in explanations" :key="index" @article-click="article_link_click" /> + <DefElement :body="explanation" :dictionary="dictionary" :has_article_ref=has_article_ref(explanation) v-for="(explanation, index) in explanations" :key="index" @article-click="article_link_click" /> </ul> <div v-if="examples.length"> <h4>{{example_header}}</h4> @@ -64,7 +64,16 @@ var Definition = { methods: { article_link_click: function(item) { this.$emit('article-click', item) - } + }, + has_article_ref: function(item){ + if(item.items.length && item.items[0].type_ == "article_ref") + { + return "true"; + } + else{ + return "false"; + } + } }, watch:{ $route(to, from) { @@ -96,4 +105,10 @@ h4 { padding-left: 12px; padding-top: 6px; } + +li[has_article_ref="true"] { + margin-top: 8px; + margin-left: -25px; +} + </style> -- GitLab