remove clickCatcher: user_organization_autocomplete

This commit is contained in:
Felix Niklas 2015-12-04 14:12:02 +01:00
parent 7d5d1350b2
commit 20b41596b6

View file

@ -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')