From 3622ca0cfb18d15967eaebf86b40bfe55987023e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 30 Sep 2015 14:05:38 +0200 Subject: [PATCH] Fixed loading highlighter at loading tasks with highlighter on app boot. --- .../app/controllers/ticket_zoom.coffee | 17 ++++++++++++----- .../app/lib/app_post/task_manager.coffee | 7 +++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.coffee index def756f91..25f5242b2 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.coffee @@ -105,12 +105,10 @@ class App.TicketZoom extends App.Controller # start autosave @autosaveStart() - # inital load of highlights - if @highligher && !@highlighed - @highlighed = true - @highligher.loadHighlights() + if !@shown - if @shown + # inital load of highlights + @loadHighlighter() # trigger shown to article App.Event.trigger('ui::ticket::shown', { ticket_id: @ticket_id } ) @@ -269,6 +267,12 @@ class App.TicketZoom extends App.Controller @scrollPageHeader.css('transform', "translateY(#{top}px)") + loadHighlighter: => + return if !@highligher + return if @highlighed + @highlighed = true + @highligher.loadHighlights() + render: (force) => # update taskbar with new meta data @@ -366,6 +370,9 @@ class App.TicketZoom extends App.Controller if @shown + # inital load of highlights + @loadHighlighter() + # scroll to end of page @scrollToBottom() diff --git a/app/assets/javascripts/app/lib/app_post/task_manager.coffee b/app/assets/javascripts/app/lib/app_post/task_manager.coffee index 659ce1ac5..757077590 100644 --- a/app/assets/javascripts/app/lib/app_post/task_manager.coffee +++ b/app/assets/javascripts/app/lib/app_post/task_manager.coffee @@ -147,6 +147,13 @@ class _taskManagerSingleton extends Spine.Module if params.init params.params.init = true + # modify shown param for controller + if params.params + if !params.show + delete params.params.shown + else + params.params.shown = true + # remember latest active controller if params.show @activeTaskHistory.push _.clone(params)