Fixed reload of content on own change.

This commit is contained in:
Martin Edenhofer 2013-03-08 09:32:38 +01:00
parent 417657e9c8
commit d5271f8244

View file

@ -35,7 +35,7 @@ class Index extends App.Controller
@fetch(@ticket_id) @fetch(@ticket_id)
@interval( update, 30000, 'zoom_check' ) @interval( update, 30000, 'zoom_check' )
fetch: (ticket_id) -> fetch: (ticket_id, force) ->
# get data # get data
App.Com.ajax( App.Com.ajax(
@ -46,7 +46,7 @@ class Index extends App.Controller
view: @view view: @view
processData: true processData: true
success: (data, status, xhr) => success: (data, status, xhr) =>
if @dataLastCall if @dataLastCall && !force
return if _.isEqual( @dataLastCall.ticket, data.ticket) return if _.isEqual( @dataLastCall.ticket, data.ticket)
diff = difference( @dataLastCall.ticket, data.ticket ) diff = difference( @dataLastCall.ticket, data.ticket )
console.log('diff', diff) console.log('diff', diff)
@ -439,12 +439,12 @@ class Index extends App.Controller
@log 'TicketZoom', 'error', 'update article', errors @log 'TicketZoom', 'error', 'update article', errors
article.save( article.save(
success: (r) => success: (r) =>
@fetch(@ticket.id) @fetch( @ticket.id, true )
error: (r) => error: (r) =>
@log 'TicketZoom', 'error', 'update article', r @log 'TicketZoom', 'error', 'update article', r
) )
else else
@fetch(@ticket.id) @fetch( @ticket.id, true )
) )
# errors = article.validate() # errors = article.validate()