Improved redirect.
This commit is contained in:
parent
0cc5dba532
commit
6ae6504e56
1 changed files with 19 additions and 13 deletions
|
@ -444,23 +444,29 @@ class Router extends App.Controller
|
||||||
@key = '#ticket/view/' + @view
|
@key = '#ticket/view/' + @view
|
||||||
|
|
||||||
# get data
|
# get data
|
||||||
App.Com.ajax(
|
if window.LastRefresh[ @key ] && @start_page is 1
|
||||||
type: 'GET',
|
@tickets_count = window.LastRefresh[ @key ].tickets_count
|
||||||
url: '/ticket_overviews',
|
@tickets = window.LastRefresh[ @key ].tickets
|
||||||
data: {
|
@redirect()
|
||||||
view: @view,
|
else
|
||||||
view_mode: 's',
|
App.Com.ajax(
|
||||||
start_page: 1,
|
type: 'GET',
|
||||||
}
|
url: '/ticket_overviews',
|
||||||
processData: true,
|
data: {
|
||||||
success: @load
|
view: @view,
|
||||||
)
|
view_mode: 's',
|
||||||
|
start_page: 1,
|
||||||
|
}
|
||||||
|
processData: true,
|
||||||
|
success: @load
|
||||||
|
)
|
||||||
|
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue