24 lines
626 B
JavaScript
24 lines
626 B
JavaScript
export default function subscriptionSelect() {
|
|
$('.js-subscription-event').each((i, element) => {
|
|
const fieldName = $(element).data('field-name');
|
|
|
|
return $(element).glDropdown({
|
|
selectable: true,
|
|
fieldName,
|
|
toggleLabel(selected, el, instance) {
|
|
let label = 'Subscription';
|
|
const $item = instance.dropdown.find('.is-active');
|
|
if ($item.length) {
|
|
label = $item.text();
|
|
}
|
|
return label;
|
|
},
|
|
clicked(options) {
|
|
return options.e.preventDefault();
|
|
},
|
|
id(obj, el) {
|
|
return $(el).data('id');
|
|
},
|
|
});
|
|
});
|
|
}
|