Improved AJAX calls.
This commit is contained in:
parent
c76cb060a5
commit
99d1bfce00
13 changed files with 31 additions and 45 deletions
|
@ -604,8 +604,7 @@ class App.Controller extends Spine.Controller
|
|||
|
||||
# get data
|
||||
@tickets = {}
|
||||
ajax = new App.Ajax
|
||||
ajax.ajax(
|
||||
App.Com.ajax(
|
||||
type: 'GET',
|
||||
url: '/ticket_customer',
|
||||
data: {
|
||||
|
|
|
@ -18,10 +18,8 @@ class App.DashboardActivityStream extends App.Controller
|
|||
@render( window.LastRefresh[ 'dashboard_activity_stream' ] )
|
||||
|
||||
# get data
|
||||
if @req
|
||||
@req.abort()
|
||||
@ajax = new App.Ajax
|
||||
@req = @ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'dashoard_activity_stream',
|
||||
type: 'GET',
|
||||
url: '/activity_stream',
|
||||
data: {
|
||||
|
|
|
@ -11,10 +11,8 @@ class App.DashboardRecentViewed extends App.Controller
|
|||
@items = []
|
||||
|
||||
# get data
|
||||
if @req
|
||||
@req.abort()
|
||||
@ajax = new App.Ajax
|
||||
@req = @ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'dashboard_recent_viewed',
|
||||
type: 'GET',
|
||||
url: '/recent_viewed',
|
||||
data: {
|
||||
|
|
|
@ -15,10 +15,8 @@ class App.DashboardRss extends App.Controller
|
|||
@render( window.LastRefresh[ 'dashboard_rss' ] )
|
||||
|
||||
# get data
|
||||
if @req
|
||||
@req.abort()
|
||||
@ajax = new App.Ajax
|
||||
@req = @ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'dashboard_rss',
|
||||
type: 'GET',
|
||||
url: '/rss_fetch',
|
||||
data: {
|
||||
|
|
|
@ -26,10 +26,8 @@ class App.DashboardTicket extends App.Controller
|
|||
@render( window.LastRefresh[ @key ] )
|
||||
|
||||
# get data
|
||||
if @req
|
||||
@req.abort()
|
||||
@ajax = new App.Ajax
|
||||
@req = @ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'dashboard_ticket_' + @key,
|
||||
type: 'GET',
|
||||
url: '/ticket_overviews',
|
||||
data: {
|
||||
|
|
|
@ -27,10 +27,8 @@ class Index extends App.Controller
|
|||
|
||||
# get data / in case also ticket data for split
|
||||
fetch: (params) ->
|
||||
if @req
|
||||
@req.abort()
|
||||
@ajax = new App.Ajax
|
||||
@req = @ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'ticket_create',
|
||||
type: 'GET',
|
||||
url: '/ticket_create',
|
||||
data: {
|
||||
|
|
|
@ -5,8 +5,8 @@ class App.TicketHistory extends App.ControllerModal
|
|||
|
||||
fetch: (@ticket_id) ->
|
||||
# get data
|
||||
@ajax = new App.Ajax
|
||||
@ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'ticket_history',
|
||||
type: 'GET',
|
||||
url: '/ticket_history/' + ticket_id,
|
||||
success: (data, status, xhr) =>
|
||||
|
|
|
@ -16,8 +16,8 @@ class App.TicketMerge extends App.ControllerModal
|
|||
params = @formParam(e.target)
|
||||
|
||||
# merge tickets
|
||||
@ajax = new App.Ajax
|
||||
@ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'ticket_merge',
|
||||
type: 'GET',
|
||||
url: '/ticket_merge/' + @ticket_id + '/' + params['master_ticket_number'],
|
||||
data: {
|
||||
|
|
|
@ -45,10 +45,8 @@ class Index extends App.Controller
|
|||
@render()
|
||||
|
||||
# get data
|
||||
if @req
|
||||
@req.abort()
|
||||
@ajax = new App.Ajax
|
||||
@req = @ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'ticket_overview',
|
||||
type: 'GET',
|
||||
url: '/ticket_overviews',
|
||||
data: {
|
||||
|
|
|
@ -30,8 +30,8 @@ class Index extends App.Controller
|
|||
fetch: (ticket_id) ->
|
||||
|
||||
# get data
|
||||
@ajax = new App.Ajax
|
||||
@ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'ticket_zoom',
|
||||
type: 'GET',
|
||||
url: '/ticket_full/' + ticket_id,
|
||||
data: {
|
||||
|
|
|
@ -22,8 +22,8 @@ class Index extends App.Controller
|
|||
fetch: ->
|
||||
|
||||
# get data
|
||||
@ajax = new App.Ajax
|
||||
@ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'getting_started',
|
||||
type: 'GET',
|
||||
url: '/getting_started',
|
||||
data: {
|
||||
|
|
|
@ -138,9 +138,8 @@ class App.Navigation extends App.Controller
|
|||
# only of lod request is already done
|
||||
|
||||
if !@req_overview
|
||||
@ajax = new App.Ajax
|
||||
# @req_overview.abort()
|
||||
@req_overview = @ajax.ajax(
|
||||
@req_overview = App.Com.ajax(
|
||||
id: 'navbar_ticket_overviews',
|
||||
type: 'GET',
|
||||
url: '/ticket_overviews',
|
||||
data: {},
|
||||
|
@ -184,8 +183,8 @@ class App.Navigation extends App.Controller
|
|||
|
||||
# only of lod request is already done
|
||||
if !@req_recent_viewed
|
||||
@ajax = new App.Ajax
|
||||
@req_recent_viewed = @ajax.ajax(
|
||||
@req_recent_viewed = App.Com.ajax(
|
||||
id: 'navbar_recent_viewed',
|
||||
type: 'GET',
|
||||
url: '/recent_viewed',
|
||||
data: {
|
||||
|
|
|
@ -30,8 +30,8 @@ class Index extends App.Controller
|
|||
params = @formParam(e.target)
|
||||
|
||||
# get data
|
||||
ajax = new App.Ajax
|
||||
ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'password_reset',
|
||||
type: 'POST',
|
||||
url: '/users/password_reset',
|
||||
data: JSON.stringify(params),
|
||||
|
@ -63,10 +63,10 @@ class Verify extends App.Controller
|
|||
@navupdate '#reset_password_verify'
|
||||
|
||||
# get data
|
||||
ajax = new App.Ajax
|
||||
params = {}
|
||||
params['token'] = @token
|
||||
ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'passwort_reset_verify',
|
||||
type: 'POST',
|
||||
url: '/users/password_reset_verify',
|
||||
data: JSON.stringify(params),
|
||||
|
@ -96,8 +96,8 @@ class Verify extends App.Controller
|
|||
params['token'] = @token
|
||||
|
||||
# get data
|
||||
ajax = new App.Ajax
|
||||
ajax.ajax(
|
||||
App.Com.ajax(
|
||||
id: 'password_reset_verify',
|
||||
type: 'POST',
|
||||
url: '/users/password_reset_verify',
|
||||
data: JSON.stringify(params),
|
||||
|
|
Loading…
Reference in a new issue