2016-08-05 02:57:53 -04:00
|
|
|
|
(global => {
|
|
|
|
|
global.gl = global.gl || {};
|
2016-08-03 17:45:38 -04:00
|
|
|
|
|
2016-08-05 02:57:53 -04:00
|
|
|
|
gl.ProtectedBranchAccessDropdown = class {
|
|
|
|
|
constructor(options) {
|
|
|
|
|
const { $dropdown, data, onSelect } = options;
|
|
|
|
|
|
|
|
|
|
$dropdown.glDropdown({
|
|
|
|
|
data: data,
|
|
|
|
|
selectable: true,
|
2016-08-05 18:04:10 -04:00
|
|
|
|
inputId: $dropdown.data('input-id'),
|
2016-08-05 02:57:53 -04:00
|
|
|
|
fieldName: $dropdown.data('field-name'),
|
|
|
|
|
toggleLabel(item) {
|
|
|
|
|
return item.text;
|
|
|
|
|
},
|
|
|
|
|
clicked(item, $el, e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
onSelect();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2016-08-03 17:45:38 -04:00
|
|
|
|
}
|
2016-08-05 02:57:53 -04:00
|
|
|
|
|
|
|
|
|
})(window);
|