From b828c7bda0c524e4f34ae5f44f61392021ba8ab9 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Mon, 24 Aug 2020 12:58:20 +0200 Subject: [PATCH] Follow up - f54df50 - Fixes #3040: Use focusout instead of click event to stabilize tests. --- .../app/controllers/ticket_zoom/article_new.coffee | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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 c69a58c27..31cd97ea9 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_new.coffee @@ -60,7 +60,6 @@ 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) @@ -150,14 +149,9 @@ class App.TicketZoomArticleNew extends App.Controller if @subscribeIdTextModule App.Ticket.unsubscribe(@subscribeIdTextModule) - @releaseGlobalClickEvents() - - releaseGlobalClickEvents: -> - $(window).off 'click.ticket-zoom-select-type' - $(window).off 'click.ticket-zoom-textarea' + $(window).off('click.ticket-zoom-select-type') render: -> - @releaseGlobalClickEvents() ticket = App.Ticket.fullLocal(@ticket_id) @html App.view('ticket_zoom/article_new')( @@ -517,7 +511,7 @@ class App.TicketZoomArticleNew extends App.Controller options: duration: duration easing: 'easeOutQuad' - complete: => $(window).off('click.ticket-zoom-textarea').on('click.ticket-zoom-textarea', @closeTextarea) + complete: => @textarea.off('focusout.ticket-zoom-textarea').on('focusout.ticket-zoom-textarea', @closeTextarea) @textBubble.velocity properties: @@ -562,7 +556,7 @@ class App.TicketZoomArticleNew extends App.Controller closeTextarea: => if !@textarea.text().trim() && !@attachments.length && not @isIE10() - $(window).off 'click.ticket-zoom-textarea' + @textarea.off('focusout.ticket-zoom-textarea') @textarea.velocity properties: