Improved redirect.

This commit is contained in:
Martin Edenhofer 2012-07-20 13:37:51 +02:00
parent 0cc5dba532
commit 6ae6504e56

View file

@ -444,6 +444,11 @@ class Router extends App.Controller
@key = '#ticket/view/' + @view @key = '#ticket/view/' + @view
# get data # get data
if window.LastRefresh[ @key ] && @start_page is 1
@tickets_count = window.LastRefresh[ @key ].tickets_count
@tickets = window.LastRefresh[ @key ].tickets
@redirect()
else
App.Com.ajax( App.Com.ajax(
type: 'GET', type: 'GET',
url: '/ticket_overviews', url: '/ticket_overviews',
@ -457,10 +462,11 @@ class Router extends App.Controller
) )
load: (data) => load: (data) =>
@tickets = data.tickets @tickets = data.tickets
@tickets_count = data.tickets_count @tickets_count = data.tickets_count
@redirect()
redirect: =>
Config['LastOverview'] = @view Config['LastOverview'] = @view
Config['LastOverviewPosition'] = @position Config['LastOverviewPosition'] = @position
Config['LastOverviewTotal'] = @tickets_count Config['LastOverviewTotal'] = @tickets_count