From 91aeca03843426a9aa449c8a0a0248f028cc7781 Mon Sep 17 00:00:00 2001
From: Henrik Askjer <henrik.askjer@uib.no>
Date: Mon, 27 Dec 2021 14:44:14 +0100
Subject: [PATCH] disable highligt in expressions

---
 src/components/Definition.vue | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/components/Definition.vue b/src/components/Definition.vue
index 1e5e8494..23326e25 100644
--- a/src/components/Definition.vue
+++ b/src/components/Definition.vue
@@ -1,6 +1,6 @@
 <template>
-  <li :class="['definition', 'level'+level]" :ref="'def' + body.id" :id="'def' + body.id">
-    <ul class="explanations">
+  <li :class="['definition', 'level'+level]"  :ref="allow_higlight ? 'def' + body.id : ''" :id="allow_higlight? 'def' + body.id : ''">
+    <ul class="explanations" >
       <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">
@@ -13,7 +13,7 @@
       <CompoundList :body="compound_list" :dictionary="dictionary" v-for="(compound_list, index) in compund_lists" :key="index" @article-click="article_link_click" />
     </ul>
     <div :is="level < 3 ? 'ol' : 'ul'" class="sub_definitions" v-if="subdefs.length">
-      <Definition :level="level+1" :body="subdef" v-for="(subdef, index) in subdefs"  :dictionary="dictionary" :key="index" @article-click="article_link_click" />
+      <Definition :allow_higlight="subdef.id != body.id" :level="level+1" :body="subdef" v-for="(subdef, index) in subdefs"  :dictionary="dictionary" :key="index" @article-click="article_link_click" />
     </div>
   </li>
 </template>
@@ -28,7 +28,8 @@ var Definition = {
   props: {
     body: Object,
     level: Number,
-    dictionary: String
+    dictionary: String,
+    allow_higlight: Boolean
   },
   components: {
     DefElement,
@@ -57,7 +58,7 @@ var Definition = {
   mounted: function() {
     let ref = 'def' + this.body.id
     if(location.hash.substring(1) == ref){
-      this.$refs[ref].scrollIntoView()
+      this.$refs[ref].scrollIntoView({block: 'center'})
       this.$refs[ref].classList.add('highlighted')
     }
   },
-- 
GitLab