Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Historiana
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Paul Jongsma
Historiana
Commits
83e443e0
Commit
83e443e0
authored
Mar 06, 2017
by
Paul Jongsma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
displayname in global store.displayname instead of computed
parent
edca34d5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
14 deletions
+40
-14
src/components/Builder.vue
src/components/Builder.vue
+1
-1
src/components/Header.vue
src/components/Header.vue
+10
-9
src/main.js
src/main.js
+10
-0
src/pages/BlockEditor.vue
src/pages/BlockEditor.vue
+19
-4
No files found.
src/components/Builder.vue
View file @
83e443e0
...
...
@@ -103,7 +103,7 @@
components
:
{
Dropzone
,
MyLabel
},
},
mounted
:
function
()
{
//init foundation on this compoment and create ref to global store
$
(
this
.
$el
).
foundation
();
...
...
src/components/Header.vue
View file @
83e443e0
...
...
@@ -83,7 +83,7 @@
<ul
class=
"menu align-right"
>
<li
@
click=
"gotoprofile"
class=
"username"
v-if=
"this.$store.state.loggedIn"
>
<!--router-link to="/my/profile">
{{
displayname
}}
</router-link-->
{{
displayname
}}
{{
this
.
$store
.
state
.
displayname
}}
</li>
...
...
@@ -159,14 +159,15 @@
window
.
jQuery
(
document
).
foundation
();
},
computed
:
{
displayname
:
function
(
e
)
{
var
a
=
[
this
.
$store
.
state
.
user
.
name
,
this
.
$store
.
state
.
user
.
login
,
this
.
$store
.
state
.
user
.
email
]
return
a
.
filter
(
n
=>
n
)[
0
]
||
'
Anonymous
'
}
// moved to main
// displayname: function (e) {
// var a = [
// this.$store.state.user.name,
// this.$store.state.user.login,
// this.$store.state.user.email
// ]
// return a.filter(n => n)[0] || 'Anonymous'
// }
},
methods
:
{
gotoprofile
:
function
(
e
)
{
...
...
src/main.js
View file @
83e443e0
...
...
@@ -44,6 +44,7 @@ const store = new Vuex.Store({
state
:
{
count
:
0
,
loggedIn
:
false
,
displayname
:
'
Anonymous
'
,
user
:
{},
activity
:
{
next
:
dummy
,
...
...
@@ -98,6 +99,15 @@ const store = new Vuex.Store({
setUser
(
state
,
user
)
{
state
.
user
=
user
state
.
displayname
=
function
(
e
)
{
var
a
=
[
state
.
user
.
name
,
state
.
user
.
login
,
state
.
user
.
email
]
return
a
.
filter
(
n
=>
n
)[
0
]
||
'
Anonymous
'
}()
}
}
})
...
...
src/pages/BlockEditor.vue
View file @
83e443e0
...
...
@@ -8,9 +8,15 @@
</div>
<div
class=
"title-bar-right"
>
<ul
class=
"menu simple align-right"
>
<li><a
href=
"/#/builder"
><i
class=
"fa fa-arrow-left"
></i>
Back to Builder
</a></li>
<li><a
href=
""
><i
class=
"fa fa-sign-in"
></i>
Login
</a></li>
<li><a
href=
""
><i
class=
"fa fa-user"
></i>
Register
</a></li>
<li><a
href=
"/#/builder"
><i
class=
"fa fa-arrow-left"
></i>
Back to Builder
</a></li>
<li
v-if=
"this.$store.state.loggedIn"
class=
"username"
>
<!--router-link to="/my/profile">
{{
displayname
}}
</router-link-->
{{
this
.
$store
.
state
.
displayname
}}
</li>
<li
v-else
><a
href=
""
><i
class=
"fa fa-sign-in"
></i>
Login
</a></li>
<li
v-else
><a
href=
""
><i
class=
"fa fa-user"
></i>
Register
</a></li>
</ul>
</div>
</div>
...
...
@@ -89,6 +95,14 @@
import
navBuildingBlock
from
'
../tags/navBuildingBlock
'
export
default
{
name
:
'
builder-editor
'
,
created
()
{
this
.
$on
(
'
some-event
'
,
function
()
{
// window.alert('someeventdonxxe')
console
.
log
(
'
** help clicked
'
)
})
},
components
:
{
navBuildingBlock
},
...
...
@@ -103,7 +117,7 @@
this
.
$store
.
state
.
activity
.
prev
=
blocks
[
blockOrder
[
blockOrder
.
indexOf
(
current
)
-
1
]
]
||
{
href
:
null
}
}
},
computed
:
{
computed
:
{
blocks
()
{
console
.
log
(
'
computed blocksssss:
'
)
return
this
.
$store
.
state
.
activity
.
bblocks
...
...
@@ -131,6 +145,7 @@
var
blockOrder
=
this
.
$store
.
state
.
activity
.
blockOrder
this
.
$store
.
state
.
activity
.
currentBlock
=
current
this
.
$store
.
state
.
activity
.
currentType
=
blocks
[
current
].
type
this
.
$store
.
state
.
activity
.
next
=
blocks
[
blockOrder
[
blockOrder
.
indexOf
(
current
)
+
1
]
]
||
{
href
:
null
}
this
.
$store
.
state
.
activity
.
prev
=
blocks
[
blockOrder
[
blockOrder
.
indexOf
(
current
)
-
1
]
]
||
{
href
:
null
}
},
...
...
Write
Preview
Markdown
is supported
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