debian-mirror-gitlab/app/assets/javascripts/ui_development_kit.js

24 lines
548 B
JavaScript
Raw Normal View History

2018-05-09 12:01:36 +05:30
import $ from 'jquery';
2017-09-10 17:25:29 +05:30
import Api from './api';
2018-03-27 19:54:05 +05:30
export default () => {
2017-09-10 17:25:29 +05:30
$('#js-project-dropdown').glDropdown({
data: (term, callback) => {
Api.projects(term, {
order_by: 'last_activity_at',
}, (data) => {
callback(data);
});
},
text: project => (project.name_with_namespace || project.name),
selectable: true,
fieldName: 'author_id',
filterable: true,
search: {
fields: ['name_with_namespace'],
},
id: data => data.id,
isSelected: data => (data.id === 2),
});
2018-03-27 19:54:05 +05:30
};