Improved logout (do redirect before rerender).

This commit is contained in:
Martin Edenhofer 2016-05-31 01:15:01 +02:00
parent aabffa8ca4
commit 4cc68551d9
7 changed files with 16 additions and 18 deletions

View file

@ -133,7 +133,7 @@ class App.Controller extends Spine.Controller
updateNavMenu: =>
delay = ->
App.Event.trigger('menu:render')
@delay(delay, 200)
@delay(delay, 150)
scrollTo: (x = 0, y = 0, delay = 0) ->
a = ->

View file

@ -4,10 +4,5 @@ class Index extends App.ControllerContent
App.Auth.logout()
# redirect to login
redirect = =>
@navigate 'login'
@delay redirect, 100
App.Config.set('logout', Index, 'Routes')
App.Config.set('Logout', { prio: 1800, parent: '#current_user', name: 'Sign out', translate: true, target: '#logout', divider: true, iconClass: 'signout', role: [ 'Agent', 'Customer' ] }, 'NavBarRight')

View file

@ -141,6 +141,7 @@ class App.Auth
App.Event.trigger('auth')
App.Event.trigger('auth:logout')
window.location.href = '#login'
if rerender
App.Event.trigger('ui:rerender')
App.Event.trigger('clearStore')

View file

@ -68,6 +68,8 @@
<%- @T('will be created') %>
<% else if item.to_delete is true: %>
<%- @T('will be deleted') %>
<% else if item.to_migrate is true || item.to_config is true: %>
<%- @T('has changed') %>
<% else if item.editable isnt false: %>
<a href="#" class="js-delete" title="<%- @Ti('Delete') %>"><%- @Icon('trash') %></a>
<% end %>