From 040b0581fbe81549069a7dc4c513da9e2d9f4667 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 19 Jun 2013 10:21:48 +0200 Subject: [PATCH] Fixed not working text modules. --- .../controllers/agent_ticket_create.js.coffee | 2 +- .../controllers/text_module_widget.js.coffee | 3 +-- .../app/controllers/ticket_zoom.js.coffee | 18 +++++++++--------- .../views/ticket_zoom/ticket_action.jst.eco | 1 - 4 files changed, 11 insertions(+), 13 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 a4d3a33c4..6a5104bff 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -217,7 +217,7 @@ class App.TicketCreate extends App.Controller # show text module UI new App.TextModuleUI( - el: @el.find('[data-id="text_module"]'), + el: @el, ) @formDefault = @formParam( @el.find('.ticket-create') ) diff --git a/app/assets/javascripts/app/controllers/text_module_widget.js.coffee b/app/assets/javascripts/app/controllers/text_module_widget.js.coffee index d59bd6635..fb94c8dbb 100644 --- a/app/assets/javascripts/app/controllers/text_module_widget.js.coffee +++ b/app/assets/javascripts/app/controllers/text_module_widget.js.coffee @@ -26,8 +26,7 @@ class App.TextModuleUI extends App.Controller .find('small') .text("(" + e.keywords + ")").end() element.append(template) - $('textarea').sew({values: values, token: '::', elementFactory: elementFactory }) - + @el.find('textarea').sew({values: values, token: '::', elementFactory: elementFactory }) class App.TextModuleUIOld extends App.Controller events: diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 42d6a32fa..701dac00b 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -147,8 +147,7 @@ class App.TicketZoom extends App.Controller render: (force) => # get data - if !@ticket - @ticket = App.Collection.find( 'Ticket', @ticket_id ) + @ticket = App.Collection.find( 'Ticket', @ticket_id ) # update taskbar with new meta data App.Event.trigger 'task:render' @@ -173,6 +172,14 @@ class App.TicketZoom extends App.Controller @editDone = true @Edit() + # show text module UI + if !@isRole('Customer') + new App.TextModuleUI( + el: @el + data: + ticket: @ticket + ) + # scroll to article if given if @article_id && document.getElementById( 'article-' + @article_id ) offset = document.getElementById( 'article-' + @article_id ).offsetTop @@ -309,13 +316,6 @@ class TicketAction extends App.Controller object: @ticket ) - # show text module UI - if !@isRole('Customer') - new App.TextModuleUI( - el: @el.find('.text_module') - data: - ticket: @ticket - ) class Edit extends App.Controller diff --git a/app/assets/javascripts/app/views/ticket_zoom/ticket_action.jst.eco b/app/assets/javascripts/app/views/ticket_zoom/ticket_action.jst.eco index d40a3a3ec..7b156d69b 100644 --- a/app/assets/javascripts/app/views/ticket_zoom/ticket_action.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom/ticket_action.jst.eco @@ -2,4 +2,3 @@
-