diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.coffee index 89ae5f150..80c5fe9f0 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.coffee @@ -24,11 +24,6 @@ class App.TicketCreate extends App.Controller @buildScreen(params) @bindId = App.TicketCreateCollection.one(load) - # lisen if view need to be rerendered - @bind 'ticket_create_rerender', (defaults) => - @log 'notice', 'error', defaults - @render(defaults) - # rerender view, e. g. on langauge change @bind 'ui:rerender', => return if !@authenticateCheck() @@ -116,9 +111,11 @@ class App.TicketCreate extends App.Controller show: => @navupdate "#ticket/create/id/#{@id}#{@split}", type: 'menu' @autosaveStart() + @bind('ticket_create_rerender', (template) => @render(template)) hide: => @autosaveStop() + @unbind('ticket_create_rerender', (template) => @render(template)) changed: => formCurrent = @formParam( @$('.ticket-create') ) diff --git a/app/assets/javascripts/app/controllers/widget/template.coffee b/app/assets/javascripts/app/controllers/widget/template.coffee index 224ad0f6c..82e42f6bb 100644 --- a/app/assets/javascripts/app/controllers/widget/template.coffee +++ b/app/assets/javascripts/app/controllers/widget/template.coffee @@ -83,11 +83,10 @@ class App.WidgetTemplate extends App.Controller e.preventDefault() # get params - form = @formParam($('.ticket-create')) + form = @formParam($(e.target).closest('.content').find('.ticket-create')) params = @formParam(e.target) name = params['template_name'] return if !name -# delete params['template_name'] template = App.Template.findByAttribute('name', name) if !template