gitlab-org--gitlab-foss/app/assets/javascripts/blob/blob_license_selectors.js.coffee
Alfredo Sumaran e8a467e094 Implements TemplateDropdown class to create custom template dropdowns
Also License dropdown has been ported to use our GL dropdown instead of Select2.
Fixes tests to make it work with current implementation
2016-06-16 00:28:45 -05:00

17 lines
453 B
CoffeeScript

class @BlobLicenseSelectors
constructor: (opts) ->
{
@$dropdowns = $('.js-license-selector')
@editor
} = opts
@$dropdowns.each (i, dropdown) =>
$dropdown = $(dropdown)
new BlobLicenseSelector(
pattern: /^(.+\/)?(licen[sc]e|copying)($|\.)/i,
data: $dropdown.data('data'),
wrapper: $dropdown.closest('.js-license-selector-wrap'),
dropdown: $dropdown,
editor: @editor
)