gitlab-org--gitlab-foss/app/assets/javascripts/issue_status_select.js
Brandon Labuschagne ed8dc177ed I18N JS files starting with i
This is one of many MRs opened in order to improve the overall
internationalisation of the GitLab codebase.

This commit only targets Vanilla JS files.

i18n documentation
https://docs.gitlab.com/ee/development/i18n/externalization.html
2019-05-07 19:27:52 +02:00

26 lines
671 B
JavaScript

import $ from 'jquery';
import { __ } from './locale';
export default function issueStatusSelect() {
$('.js-issue-status').each((i, el) => {
const fieldName = $(el).data('fieldName');
return $(el).glDropdown({
selectable: true,
fieldName,
toggleLabel(selected, element, instance) {
let label = __('Author');
const $item = instance.dropdown.find('.is-active');
if ($item.length) {
label = $item.text();
}
return label;
},
clicked(options) {
return options.e.preventDefault();
},
id(obj, element) {
return $(element).data('id');
},
});
});
}