From 3feff9e70b30e7c1f0dbd8ef63f223f6815eb700 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 23 Apr 2013 21:00:31 +0200 Subject: [PATCH] Activate task controller of init call. --- .../app/controllers/agent_ticket_create.js.coffee | 3 +-- .../app/controllers/user_info_widget.js.coffee | 2 -- .../app/lib/app_post/task_manager.js.coffee | 11 +++++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 32f48a5cc..c68bc3fdf 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -12,7 +12,6 @@ class App.TicketCreate extends App.Controller return if !@authenticate() # set title - @title 'New Ticket' @form_id = App.ControllerForm.formId() @edit_form = undefined @@ -62,7 +61,7 @@ class App.TicketCreate extends App.Controller activate: => @navupdate '#' -# @title 'Ticket Create ' + @ticket.number + @title @article_attributes['title'] release: => # @clearInterval( @key, 'ticket_zoom' ) diff --git a/app/assets/javascripts/app/controllers/user_info_widget.js.coffee b/app/assets/javascripts/app/controllers/user_info_widget.js.coffee index e1748e617..a91eea985 100644 --- a/app/assets/javascripts/app/controllers/user_info_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/user_info_widget.js.coffee @@ -1,5 +1,3 @@ -$ = jQuery.sub() - class App.UserInfo extends App.Controller events: 'focusout [data-type=update]': 'update', diff --git a/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee b/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee index 85688a177..297aa4f40 100644 --- a/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee @@ -83,10 +83,14 @@ class _Singleton extends App.Controller else $('#content_permanent_' + @task_count ).removeClass('active') $('#content_permanent_' + @task_count ).hide() + + # create new controller instanz params_app = _.clone(params) params_app['el'] = $('#content_permanent_' + @task_count ) params_app['task_key'] = @task_count a = new App[callback]( params_app ) + + # remember new controller / prepare for task storage task = type: type type_id: type_id @@ -95,7 +99,14 @@ class _Singleton extends App.Controller worker: a active: active @tasks[@task_count] = task + + # activate controller + if !to_not_show + a.activate() + App.Event.trigger 'ui:rerender' + + # add new controller to task storage if !to_not_show @syncAdd(task)