From 20b41596b678bc53eaf770b2424c0894e7461b8a Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Fri, 4 Dec 2015 14:12:02 +0100 Subject: [PATCH] remove clickCatcher: user_organization_autocomplete --- .../user_organization_autocompletion.coffee | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/user_organization_autocompletion.coffee b/app/assets/javascripts/app/lib/app_post/user_organization_autocompletion.coffee index 490f5a18c..9b0f74306 100644 --- a/app/assets/javascripts/app/lib/app_post/user_organization_autocompletion.coffee +++ b/app/assets/javascripts/app/lib/app_post/user_organization_autocompletion.coffee @@ -7,6 +7,7 @@ class App.UserOrganizationAutocompletion extends App.Controller 'click .js-user': 'selectUser' 'click .js-userNew': 'newUser' 'focus input': 'open' + 'click': 'stopPropagation' constructor: (params) -> super @@ -25,26 +26,20 @@ class App.UserOrganizationAutocompletion extends App.Controller @el release: => - return if !@catcher - @catcher.remove() + $(window).off 'click.UserOrganizationAutocompletion' open: => @clearDelay('close') @el.addClass('open') - if @catcher - @catcher.remove() - @catcher = new App.ClickCatcher - holder: @el.offsetParent() - callback: @close - zIndexScale: 1 + + $(window).on 'click.UserOrganizationAutocompletion', @close close: => execute = => @el.removeClass('open') @delay( execute, 400, 'close' ) - if @catcher - @catcher.remove() + $(window).off 'click.UserOrganizationAutocompletion' selectUser: (e) -> userId = $(e.target).parents('.recipientList-entry').data('user-id')