Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/documents/index.html.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ aside '.app', ->
span '.link.link-page', ->
text 'Page'

span '.link.link-logout', ->
text 'Logout'

span '.right.show-page', ->
#span '.status', ->
# 'Changes saved at 10:41am'
Expand Down
16 changes: 14 additions & 2 deletions src/documents/scripts/views/app.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class App extends View
loggedInUser: currentUser
onlogin: (args...) ->
# ignore as we listen to post message
onlogout: ->
localStorage.setItem('currentUser', '')
onlogout: =>
@applyLogout()
)

# Login the user if we already have one
Expand Down Expand Up @@ -256,6 +256,15 @@ class App extends View
# Chain
@

applyLogout: ->
localStorage.removeItem('currentUser')
@currentSite = null
@currentFileCollection = null
@currentFile = null
@editView = null
@setAppMode('login')
@navigate('/')
@


# ---------------------------------
Expand Down Expand Up @@ -429,6 +438,9 @@ class App extends View
site: @currentSite
fileCollection: @currentFileCollection
})
when $target.hasClass('link-logout')
@applyLogout()
navigator.id?.logout?()

# Chain
@
Expand Down
9 changes: 9 additions & 0 deletions src/documents/styles/app.css.styl
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,15 @@ select.collection-list
&:before
border: heightSwitch solid colorPageBackground

&.link-logout
z-index: 2
padding-left: (paddingBodySides * 1.5)
margin-left: (paddingBodySides * -1)
&, &:after
background: colorCancelBackground
&:before
border: heightSwitch solid colorCancelBackground

&:before
width: 0
height: 0
Expand Down