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-user': 'selectUser'
'click .js-userNew': 'newUser' 'click .js-userNew': 'newUser'
'focus input': 'open' 'focus input': 'open'
'click': 'stopPropagation'
constructor: (params) -> constructor: (params) ->
super super
@ -25,26 +26,20 @@ class App.UserOrganizationAutocompletion extends App.Controller
@el @el
release: => release: =>
return if !@catcher $(window).off 'click.UserOrganizationAutocompletion'
@catcher.remove()
open: => open: =>
@clearDelay('close') @clearDelay('close')
@el.addClass('open') @el.addClass('open')
if @catcher
@catcher.remove() $(window).on 'click.UserOrganizationAutocompletion', @close
@catcher = new App.ClickCatcher
holder: @el.offsetParent()
callback: @close
zIndexScale: 1
close: => close: =>
execute = => execute = =>
@el.removeClass('open') @el.removeClass('open')
@delay( execute, 400, 'close' ) @delay( execute, 400, 'close' )
if @catcher $(window).off 'click.UserOrganizationAutocompletion'
@catcher.remove()
selectUser: (e) -> selectUser: (e) ->
userId = $(e.target).parents('.recipientList-entry').data('user-id') userId = $(e.target).parents('.recipientList-entry').data('user-id')