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: -> authenticate: ->
console.log 'authenticate', window.Session console.log 'authenticate', window.Session
# return rtue if session exists
return true if window.Session['id'] return true if window.Session['id']
# remember requested url
window.Config['requested_url'] = window.location.hash
# redirect to login # redirect to login
@navigate '#login' @navigate '#login'
return false return false

View file

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

View file

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