diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee index 31cd97ea9..c69a58c27 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee @@ -60,6 +60,7 @@ class App.TicketZoomArticleNew extends App.Controller @setArticleTypePre(data.type.name, data.signaturePosition) + @openTextarea(null, true) for key, value of data.article if key is 'body' @$("[data-name=\"#{key}\"]").html(value) @@ -149,9 +150,14 @@ class App.TicketZoomArticleNew extends App.Controller if @subscribeIdTextModule App.Ticket.unsubscribe(@subscribeIdTextModule) - $(window).off('click.ticket-zoom-select-type') + @releaseGlobalClickEvents() + + releaseGlobalClickEvents: -> + $(window).off 'click.ticket-zoom-select-type' + $(window).off 'click.ticket-zoom-textarea' render: -> + @releaseGlobalClickEvents() ticket = App.Ticket.fullLocal(@ticket_id) @html App.view('ticket_zoom/article_new')( @@ -511,7 +517,7 @@ class App.TicketZoomArticleNew extends App.Controller options: duration: duration easing: 'easeOutQuad' - complete: => @textarea.off('focusout.ticket-zoom-textarea').on('focusout.ticket-zoom-textarea', @closeTextarea) + complete: => $(window).off('click.ticket-zoom-textarea').on('click.ticket-zoom-textarea', @closeTextarea) @textBubble.velocity properties: @@ -556,7 +562,7 @@ class App.TicketZoomArticleNew extends App.Controller closeTextarea: => if !@textarea.text().trim() && !@attachments.length && not @isIE10() - @textarea.off('focusout.ticket-zoom-textarea') + $(window).off 'click.ticket-zoom-textarea' @textarea.velocity properties: