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 %>

View file

@ -11,10 +11,10 @@
<% if @organization[row.name] || row.name is 'note': %>
<div class="sidebar-block">
<% if row.tag isnt 'richtext': %>
<label><%- @T( row.display ) %></label>
<%- @P( @organization, row.name ) %>
<label><%- @T(row.display) %></label>
<%- @P(@organization, row.name) %>
<% 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>
<% end %>
</div>

View file

@ -6,10 +6,10 @@
<% if @user[row.name] || row.name is 'note': %>
<div class="sidebar-block">
<% if row.tag isnt 'richtext': %>
<label><%- @T( row.display ) %></label>
<%- @P( @user, row.name ) %>
<label><%- @T(row.display) %></label>
<%- @P(@user, row.name) %>
<% 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>
<% end %>
</div>

View file

@ -9,11 +9,11 @@ class Store
add new file to store
store_file_id = Store::File.add(binary_data)
store_file_id = Store::File.add(binary_data)
do also verify of written data
store_file_id = Store::File.add(binary_data, true)
store_file_id = Store::File.add(binary_data, true)
=end
@ -51,9 +51,9 @@ do also verify of written data
read content of a file
store = Store::File.find(123)
store = Store::File.find(123)
store.content # returns binary
store.content # returns binary
=end
@ -66,13 +66,13 @@ read content of a file
file system check of store, check data and sha (in case fix it)
Store::File.verify
Store::File.verify
read each file which should be in backend and verify agsinst sha hash
in case of fixing sha hash use:
Store::File.verify(true)
Store::File.verify(true)
=end