Added remember to url feature.

This commit is contained in:
Martin Edenhofer 2012-04-11 08:34:11 +02:00
parent 53ff165ba1
commit ecea57baba
3 changed files with 13 additions and 1 deletions

View file

@ -484,8 +484,13 @@ class App.Controller extends Spine.Controller
authenticate: ->
console.log 'authenticate', window.Session
# return rtue if session exists
return true if window.Session['id']
# remember requested url
window.Config['requested_url'] = window.location.hash
# redirect to login
@navigate '#login'
return false

View file

@ -71,7 +71,13 @@ class Index extends App.Controller
}
# redirect to #
@navigate '#/'
if window.Config['requested_url'] isnt ''
@navigate window.Config['requested_url']
# reset
window.Config['requested_url'] = ''
else
@navigate '#/'
error: (xhr, statusText, error) =>
console.log 'login:error'

View file

@ -2,4 +2,5 @@ var Config = {};
Config.Routes = {};
Config.NavBar = {};
Config.product_name = 'Zammad'
Config.requested_url = ''
var Session = {};