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: => updateNavMenu: =>
delay = -> delay = ->
App.Event.trigger('menu:render') App.Event.trigger('menu:render')
@delay(delay, 200) @delay(delay, 150)
scrollTo: (x = 0, y = 0, delay = 0) -> scrollTo: (x = 0, y = 0, delay = 0) ->
a = -> a = ->

View file

@ -4,10 +4,5 @@ class Index extends App.ControllerContent
App.Auth.logout() App.Auth.logout()
# redirect to login
redirect = =>
@navigate 'login'
@delay redirect, 100
App.Config.set('logout', Index, 'Routes') 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') 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')
App.Event.trigger('auth:logout') App.Event.trigger('auth:logout')
window.location.href = '#login'
if rerender if rerender
App.Event.trigger('ui:rerender') App.Event.trigger('ui:rerender')
App.Event.trigger('clearStore') App.Event.trigger('clearStore')

View file

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

View file

@ -11,10 +11,10 @@
<% if @organization[row.name] || row.name is 'note': %> <% if @organization[row.name] || row.name is 'note': %>
<div class="sidebar-block"> <div class="sidebar-block">
<% if row.tag isnt 'richtext': %> <% if row.tag isnt 'richtext': %>
<label><%- @T( row.display ) %></label> <label><%- @T(row.display) %></label>
<%- @P( @organization, row.name ) %> <%- @P(@organization, row.name) %>
<% else: %> <% else: %>
<label><%- @T( row.display ) %></label> <label><%- @T(row.display) %></label>
<div contenteditable="true" data-name="<%= row.name %>" data-type="update-org" data-placeholder="<%- @Ti('Add a Note') %>"><%- @organization[row.name] %></div> <div contenteditable="true" data-name="<%= row.name %>" data-type="update-org" data-placeholder="<%- @Ti('Add a Note') %>"><%- @organization[row.name] %></div>
<% end %> <% end %>
</div> </div>

View file

@ -6,10 +6,10 @@
<% if @user[row.name] || row.name is 'note': %> <% if @user[row.name] || row.name is 'note': %>
<div class="sidebar-block"> <div class="sidebar-block">
<% if row.tag isnt 'richtext': %> <% if row.tag isnt 'richtext': %>
<label><%- @T( row.display ) %></label> <label><%- @T(row.display) %></label>
<%- @P( @user, row.name ) %> <%- @P(@user, row.name) %>
<% else: %> <% else: %>
<label><%- @T( row.display ) %></label> <label><%- @T(row.display) %></label>
<div contenteditable="true" data-name="<%= row.name %>" data-type="update" data-placeholder="<%- @Ti('Add a Note') %>"><%- @user[row.name] %></div> <div contenteditable="true" data-name="<%= row.name %>" data-type="update" data-placeholder="<%- @Ti('Add a Note') %>"><%- @user[row.name] %></div>
<% end %> <% end %>
</div> </div>