diff --git a/app/assets/javascripts/app/controllers/_ui_element/user_autocompletion.coffee b/app/assets/javascripts/app/controllers/_ui_element/user_autocompletion.coffee index 1c88294d2..02bbcdb07 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/user_autocompletion.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/user_autocompletion.coffee @@ -1,4 +1,4 @@ # coffeelint: disable=camel_case_classes class App.UiElement.user_autocompletion - @render: (attribute) -> - new App.UserOrganizationAutocompletion(attribute: attribute).element() + @render: (attribute, params = {}) -> + new App.UserOrganizationAutocompletion(attribute: attribute, params: params).element() diff --git a/app/assets/javascripts/app/controllers/_ui_element/user_autocompletion_search.coffee b/app/assets/javascripts/app/controllers/_ui_element/user_autocompletion_search.coffee index c6c2bc4db..b8d47b42f 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/user_autocompletion_search.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/user_autocompletion_search.coffee @@ -1,6 +1,6 @@ # coffeelint: disable=camel_case_classes class App.UiElement.user_autocompletion_search - @render: (attributeOrig) -> + @render: (attributeOrig, params = {}) -> attribute = _.clone(attributeOrig) attribute.disableCreateUser = true - new App.UserOrganizationAutocompletion(attribute: attribute).element() + new App.UserOrganizationAutocompletion(attribute: attribute, params: params).element() 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 a96b611b2..b542fc746 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 @@ -23,7 +23,7 @@ class App.UserOrganizationAutocompletion extends App.Controller constructor: (params) -> super - @lazySearch = _.debounce(@searchUser, 200, true) + @lazySearch = _.debounce(@searchUser, 200) @key = Math.floor( Math.random() * 999999 ).toString() @@ -260,6 +260,8 @@ class App.UserOrganizationAutocompletion extends App.Controller name = user.displayName() if user.email name += " <#{user.email}>" + else if @params && @params["#{@attribute.name}_completion"] + name = @params["#{@attribute.name}_completion"] else @log 'userId doesn\'t exist', value