/* global dropdownSelector */ /* eslint-disable no-unused-vars */ var Status = (function() { function statusItemDropdown(options, currentValueId, columnId, formId) { var html = `'; return html; } function initialStatusItemsRequest(columnId, currentValue, formId, url) { var massageResponse = []; $.ajax({ url: url, type: 'GET', dataType: 'json', async: false, data: { column_id: columnId } }).done(function(data) { $.each(data.status_items, function(index, el) { massageResponse.push([el.id, el.status, el.icon]); }); }); return statusItemDropdown(massageResponse, currentValue, columnId, formId); } function initStatusSelectPicker($select, $hiddenField) { dropdownSelector.init($select, { noEmptyOption: true, singleSelect: true, closeOnSelect: true, selectAppearance: 'simple', onChange: function() { $hiddenField.val(dropdownSelector.getValues($select)); } }); } return { initialStatusItemsRequest: initialStatusItemsRequest, initStatusSelectPicker: initStatusSelectPicker }; }());