mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-24 20:16:08 +10:00
LDAP groups select js
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
$ ->
|
||||
ldapGroupResult = (group) ->
|
||||
group.cn
|
||||
|
||||
groupFormatSelection = (group) ->
|
||||
group.cn
|
||||
|
||||
$('.ajax-ldap-groups-select').each (i, select) ->
|
||||
$(select).select2
|
||||
id: (group) ->
|
||||
group.cn
|
||||
placeholder: "Search for a LDAP group"
|
||||
minimumInputLength: 1
|
||||
query: (query) ->
|
||||
Api.ldap_groups query.term, (groups) ->
|
||||
data = { results: groups }
|
||||
query.callback(data)
|
||||
|
||||
initSelection: (element, callback) ->
|
||||
id = $(element).val()
|
||||
if id isnt ""
|
||||
callback(cn: id)
|
||||
|
||||
formatResult: ldapGroupResult
|
||||
formatSelection: groupFormatSelection
|
||||
dropdownCssClass: "ajax-groups-dropdown"
|
||||
Reference in New Issue
Block a user