Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beta.ordbok.uib.no
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Språksamlingane
beta.ordbok.uib.no
Commits
dabbe180
Commit
dabbe180
authored
3 years ago
by
Henrik Askjer
Browse files
Options
Downloads
Patches
Plain Diff
fix errors on articles without definitions
parent
4e428046
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Article.vue
+8
-1
8 additions, 1 deletion
src/components/Article.vue
src/components/Header.vue
+2
-2
2 additions, 2 deletions
src/components/Header.vue
with
10 additions
and
3 deletions
src/components/Article.vue
+
8
−
1
View file @
dabbe180
...
@@ -87,7 +87,12 @@ export default {
...
@@ -87,7 +87,12 @@ export default {
computed
:
{
computed
:
{
snippet
:
function
()
{
snippet
:
function
()
{
return
this
.
parse_definitions
(
this
.
article
.
body
.
definitions
)
if
(
this
.
article
.
body
.
definitions
)
{
return
this
.
parse_definitions
(
this
.
article
.
body
.
definitions
)
}
return
null
},
},
collapsable
:
function
()
{
collapsable
:
function
()
{
...
@@ -136,6 +141,7 @@ export default {
...
@@ -136,6 +141,7 @@ export default {
let
definitionTexts
=
[]
let
definitionTexts
=
[]
node
.
forEach
((
definition
)
=>
{
node
.
forEach
((
definition
)
=>
{
if
(
definition
.
elements
)
{
if
(
definition
.
elements
[
0
].
content
)
{
if
(
definition
.
elements
[
0
].
content
)
{
let
new_string
=
""
let
new_string
=
""
let
old_parts
=
definition
.
elements
[
0
].
content
.
split
(
/
(\$)
/
)
let
old_parts
=
definition
.
elements
[
0
].
content
.
split
(
/
(\$)
/
)
...
@@ -171,6 +177,7 @@ export default {
...
@@ -171,6 +177,7 @@ export default {
else
if
(
definition
.
elements
[
0
].
elements
)
{
else
if
(
definition
.
elements
[
0
].
elements
)
{
definitionTexts
.
push
(
this
.
parse_definitions
(
definition
.
elements
))
definitionTexts
.
push
(
this
.
parse_definitions
(
definition
.
elements
))
}
}
}
})
})
let
definitions
=
definitionTexts
.
join
(
"
|
"
)
let
definitions
=
definitionTexts
.
join
(
"
|
"
)
...
...
This diff is collapsed.
Click to expand it.
src/components/Header.vue
+
2
−
2
View file @
dabbe180
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
</v-card>
</v-card>
</v-menu>
)
</v-menu>
)
</span>
</span>
<span
v-if=
"$parent.collapsed && $parent.has_content"
class=
"definition_snippet"
>
<span
v-if=
"$parent.collapsed &&
$parent.snippet &&
$parent.has_content"
class=
"definition_snippet"
>
|
{{$parent.snippet}}
{{group_list.length? "| ":""}}
{{$parent.snippet}}
</span>
<span
v-if=
"$parent.collapsable"
>
</span>
<span
v-if=
"$parent.collapsable"
>
<v-btn
class=
"expand_icon"
<v-btn
class=
"expand_icon"
:title=
"$parent.collapsed? 'Vis mer' : 'Kollaps'"
:title=
"$parent.collapsed? 'Vis mer' : 'Kollaps'"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment