Improved initial rendering.

This commit is contained in:
Martin Edenhofer 2015-12-01 22:02:54 +01:00
parent 8c86d87f24
commit d16f8c3078

View file

@ -284,14 +284,15 @@ class App.TicketZoom extends App.Controller
if !@renderDone if !@renderDone
@renderDone = true @renderDone = true
@html App.view('ticket_zoom') elLocal = $(App.view('ticket_zoom')
ticket: @ticket ticket: @ticket
nav: @nav nav: @nav
isCustomer: @isRole('Customer') isCustomer: @isRole('Customer')
scrollbarWidth: App.Utils.getScrollBarWidth() scrollbarWidth: App.Utils.getScrollBarWidth()
)
new App.TicketZoomOverviewNavigator( new App.TicketZoomOverviewNavigator(
el: @$('.overview-navigator') el: elLocal.find('.overview-navigator')
ticket_id: @ticket.id ticket_id: @ticket.id
overview_id: @overview_id overview_id: @overview_id
) )
@ -299,18 +300,18 @@ class App.TicketZoom extends App.Controller
new App.TicketZoomTitle( new App.TicketZoomTitle(
ticket: @ticket ticket: @ticket
overview_id: @overview_id overview_id: @overview_id
el: @$('.ticket-title') el: elLocal.find('.ticket-title')
task_key: @task_key task_key: @task_key
) )
new App.TicketZoomMeta( new App.TicketZoomMeta(
ticket: @ticket ticket: @ticket
el: @$('.ticket-meta') el: elLocal.find('.ticket-meta')
) )
new App.TicketZoomAttributeBar( new App.TicketZoomAttributeBar(
ticket: @ticket ticket: @ticket
el: @$('.js-attributeBar') el: elLocal.find('.js-attributeBar')
overview_id: @overview_id overview_id: @overview_id
callback: @submit callback: @submit
task_key: @task_key task_key: @task_key
@ -321,7 +322,7 @@ class App.TicketZoom extends App.Controller
new App.TicketZoomArticleNew( new App.TicketZoomArticleNew(
ticket: @ticket ticket: @ticket
ticket_id: @ticket.id ticket_id: @ticket.id
el: @$('.article-new') el: elLocal.find('.article-new')
formMeta: @formMeta formMeta: @formMeta
form_id: @form_id form_id: @form_id
defaults: @taskGet('article') defaults: @taskGet('article')
@ -330,17 +331,19 @@ class App.TicketZoom extends App.Controller
) )
@highligher = new App.TicketZoomHighlighter( @highligher = new App.TicketZoomHighlighter(
el: @$('.highlighter') el: elLocal.find('.highlighter')
ticket_id: @ticket.id ticket_id: @ticket.id
) )
@articleView = new App.TicketZoomArticleView( @articleView = new App.TicketZoomArticleView(
ticket: @ticket ticket: @ticket
el: @$('.ticket-article') el: elLocal.find('.ticket-article')
ui: @ ui: @
highligher: @highligher highligher: @highligher
) )
@html elLocal
# rerender whole sidebar if customer or organization has changed # rerender whole sidebar if customer or organization has changed
if @ticketLastAttributes.customer_id isnt @ticket.customer_id || @ticketLastAttributes.organization_id isnt @ticket.organization_id if @ticketLastAttributes.customer_id isnt @ticket.customer_id || @ticketLastAttributes.organization_id isnt @ticket.organization_id
new App.WidgetAvatar( new App.WidgetAvatar(