Reduced rerender calls.

This commit is contained in:
Martin Edenhofer 2015-10-01 16:04:30 +02:00
parent d48ea6e710
commit 9e2255b643

View file

@ -170,6 +170,10 @@ class App.TicketZoom extends App.Controller
@doNotLog = 1 @doNotLog = 1
@recentView( 'Ticket', ticket_id ) @recentView( 'Ticket', ticket_id )
# scroll to end of page
if force
@scrollToBottom()
error: (xhr) => error: (xhr) =>
statusText = xhr.statusText statusText = xhr.statusText
status = xhr.status status = xhr.status
@ -233,7 +237,7 @@ class App.TicketZoom extends App.Controller
@ticket.article = undefined @ticket.article = undefined
# render page # render page
@render(force) @render()
positionPageHeaderStart: => positionPageHeaderStart: =>
@ -273,13 +277,13 @@ class App.TicketZoom extends App.Controller
@highlighed = true @highlighed = true
@highligher.loadHighlights() @highligher.loadHighlights()
render: (force) => render: =>
# update taskbar with new meta data # update taskbar with new meta data
App.Event.trigger 'task:render' App.Event.trigger 'task:render'
@formEnable( @$('.submit') ) @formEnable( @$('.submit') )
if force || !@renderDone if !@renderDone
@renderDone = true @renderDone = true
@html App.view('ticket_zoom')( @html App.view('ticket_zoom')(
ticket: @ticket ticket: @ticket
@ -348,10 +352,9 @@ class App.TicketZoom extends App.Controller
# show article # show article
if !@article_view if !@article_view
@article_view = new App.TicketZoomArticleView( @article_view = new App.TicketZoomArticleView(
ticket: @ticket ticket: @ticket
el: @el.find('.ticket-article') el: @el.find('.ticket-article')
ui: @ ui: @
highlighter: @highlighter
) )
@article_view.execute( @article_view.execute(
@ -368,7 +371,8 @@ class App.TicketZoom extends App.Controller
@ticketLastAttributes = @ticket.attributes() @ticketLastAttributes = @ticket.attributes()
if @shown if @shown && !@initDone
@initDone = true
# inital load of highlights # inital load of highlights
@loadHighlighter() @loadHighlighter()
@ -589,7 +593,9 @@ class App.TicketZoom extends App.Controller
# submit changes # submit changes
ticket.save( ticket.save(
done: (r) => done: (r) =>
@renderDone = false
# enable form
@formEnable(e)
# reset article - should not be resubmited on next ticket update # reset article - should not be resubmited on next ticket update
ticket.article = undefined ticket.article = undefined