Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Opolka
vue-cdbp
Commits
05a9af2b
Commit
05a9af2b
authored
Feb 02, 2018
by
Markus Opolka
Browse files
[fix] maybe like this
parent
2b4de723
Changes
1
Show whitespace changes
Inline
Side-by-side
src/components/Letter.vue
View file @
05a9af2b
...
...
@@ -2,7 +2,15 @@
<v-container
grid-list-md
>
<v-layout
row
wrap
>
<v-flex
xs12
>
<h3>
{{
underscore
(
lettername
)
}}
</h3>
<h3>
<v-btn
:to=
"letters[0].link"
flat
icon
>
<v-icon>
keyboard_arrow_left
</v-icon>
</v-btn>
{{
underscore
(
lettername
)
}}
<v-btn
:to=
"letters[1].link"
flat
icon
>
<v-icon>
keyboard_arrow_right
</v-icon>
</v-btn>
</h3>
</v-flex>
</v-layout>
...
...
@@ -111,13 +119,24 @@ export default {
return
str
.
replace
(
'
_
'
,
'
'
)
},
breadcrumbs
(
doc
,
docs
)
{
// Create a list of precursor/predecessor elements for showing links to them
let
idx
=
docs
.
findIndex
(
function
(
elem
)
{
return
elem
.
title
===
doc
return
elem
.
name
.
replace
(
'
'
,
'
_
'
)
===
doc
})
let
start
=
idx
-
2
let
end
=
idx
+
3
this
.
letters
=
docs
.
slice
(
start
,
end
)
console
.
log
(
this
.
letters
)
// If its the first element we push the last one, negative indexing would be nice
if
(
idx
===
0
)
{
this
.
letters
.
push
(
docs
[
docs
.
length
-
1
])
}
else
{
this
.
letters
.
push
(
docs
[
idx
-
1
])
}
// this.letters.push(docs[idx])
// If its the last element we push the first one, negative indexing would be nice
if
(
idx
===
docs
.
length
-
1
)
{
this
.
letters
.
push
(
docs
[
0
])
}
else
{
this
.
letters
.
push
(
docs
[
idx
+
1
])
}
},
load
(
name
)
{
// Clear variables for idempotence
...
...
@@ -146,14 +165,16 @@ export default {
// Do this last for progress bar
this
.
letter
=
doc
.
TEI
// Load breadcrumbs
this
.
$http
.
get
(
'
http://localhost:3000/api/metadata/table
'
).
then
(
function
(
data
)
{
this
.
breadcrumbs
(
name
,
data
.
body
)
})
})
}
},
created
()
{
this
.
load
(
this
.
$route
.
params
.
letter
)
this
.
$http
.
get
(
'
http://localhost:3000/api/metadata/table
'
).
then
(
function
(
data
)
{
this
.
breadcrumbs
(
this
.
$route
.
params
.
letter
,
data
.
body
)
})
}
}
</
script
>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment