Removed use of session store to prevent store overflow.

This commit is contained in:
Martin Edenhofer 2015-11-26 00:55:56 +01:00
parent d71090df6e
commit 0de7b74ae6
2 changed files with 4 additions and 29 deletions

View file

@ -443,26 +443,12 @@ class App.Controller extends Spine.Controller
}
processData: true,
success: (data, status, xhr) ->
App.SessionStorage.set( "user-ticket-popover::#{params.user_id}", data )
# load assets
App.Collection.loadAssets( data.assets )
show( params, { open: data.ticket_ids_open, closed: data.ticket_ids_closed } )
)
# get data
data = App.SessionStorage.get( "user-ticket-popover::#{params.user_id}" )
if data
show( params, { open: data.ticket_ids_open, closed: data.ticket_ids_closed } )
@delay(
->
fetch(params)
1000
'fetch'
)
else
fetch(params)
fetch(params)
userTicketPopupsDestroy: =>
if @userTicketPopupsList

View file

@ -13,27 +13,17 @@ class App.WidgetTag extends App.Controller
constructor: ->
super
@cacheKey = "tags::#{@object_type}::#{@object.id}"
@key = "tags::#{@object_type}::#{@object.id}"
if @tags
@render()
return
@tags = App.SessionStorage.get( @cacheKey ) || []
if !_.isEmpty(@tags)
@render()
@delay(
=>
@fetch()
1000
'fetch'
)
else
@fetch()
@fetch()
fetch: =>
@ajax(
id: @cacheKey
id: @key
type: 'GET'
url: @apiPath + '/tags'
data:
@ -42,7 +32,6 @@ class App.WidgetTag extends App.Controller
processData: true
success: (data, status, xhr) =>
@tags = data.tags
App.SessionStorage.set( @cacheKey, @tags )
@render()
)