Improved update handling.
This commit is contained in:
parent
f4e38884d2
commit
6c6ee15374
1 changed files with 25 additions and 17 deletions
|
@ -19,7 +19,7 @@ class App.TicketZoom extends App.Controller
|
||||||
@load(cache)
|
@load(cache)
|
||||||
update = =>
|
update = =>
|
||||||
@fetch( @ticket_id, false )
|
@fetch( @ticket_id, false )
|
||||||
@interval( update, 300000, 'pull_check' )
|
@interval( update, 450000, 'pull_check' )
|
||||||
|
|
||||||
# fetch new data if triggered
|
# fetch new data if triggered
|
||||||
@bind(
|
@bind(
|
||||||
|
@ -220,11 +220,12 @@ class TicketTitle extends App.Controller
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
@render()
|
@subscribeId = @ticket.subscribe(@render)
|
||||||
|
@render(@ticket)
|
||||||
|
|
||||||
render: ->
|
render: (ticket) =>
|
||||||
@html App.view('ticket_zoom/title')(
|
@html App.view('ticket_zoom/title')(
|
||||||
ticket: @ticket
|
ticket: ticket
|
||||||
)
|
)
|
||||||
|
|
||||||
update: (e) =>
|
update: (e) =>
|
||||||
|
@ -241,26 +242,30 @@ class TicketTitle extends App.Controller
|
||||||
title = ''
|
title = ''
|
||||||
|
|
||||||
# update title
|
# update title
|
||||||
ticket = App.Ticket.retrieve( @ticket.id )
|
@ticket.title = title
|
||||||
ticket.title = title
|
@ticket.load( title: title )
|
||||||
ticket.load( title: title )
|
@ticket.save()
|
||||||
ticket.save()
|
|
||||||
|
|
||||||
# update taskbar with new meta data
|
# update taskbar with new meta data
|
||||||
App.Event.trigger 'task:render'
|
App.Event.trigger 'task:render'
|
||||||
|
|
||||||
|
release: =>
|
||||||
|
App.Ticket.unsubscribe( @subscribeId )
|
||||||
|
|
||||||
class TicketInfo extends App.ControllerDrox
|
class TicketInfo extends App.ControllerDrox
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
@render()
|
|
||||||
|
|
||||||
render: ->
|
@subscribeId = @ticket.subscribe(@render)
|
||||||
|
|
||||||
|
@render(@ticket)
|
||||||
|
|
||||||
|
render: (ticket) =>
|
||||||
@html @template(
|
@html @template(
|
||||||
file: 'ticket_zoom/info'
|
file: 'ticket_zoom/info'
|
||||||
header: '#' + @ticket.number
|
header: '#' + ticket.number
|
||||||
params:
|
params:
|
||||||
ticket: @ticket
|
ticket: ticket
|
||||||
)
|
)
|
||||||
|
|
||||||
# start tag controller
|
# start tag controller
|
||||||
|
@ -268,9 +273,12 @@ class TicketInfo extends App.ControllerDrox
|
||||||
new App.WidgetTag(
|
new App.WidgetTag(
|
||||||
el: @el.find('.tag_info')
|
el: @el.find('.tag_info')
|
||||||
object_type: 'Ticket'
|
object_type: 'Ticket'
|
||||||
object: @ticket
|
object: ticket
|
||||||
)
|
)
|
||||||
|
|
||||||
|
release: =>
|
||||||
|
App.Ticket.unsubscribe( @subscribeId )
|
||||||
|
|
||||||
class Widgets extends App.Controller
|
class Widgets extends App.Controller
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
|
Loading…
Reference in a new issue