diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-10-30 18:59:16 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-10-30 18:59:16 +0000 |
commit | 430131f720187772f46e776a100273aba0d13aa6 (patch) | |
tree | 256067c6fe2e9dfbdbb97189f0b00a70c13e69a2 /app/assets/javascripts/issue_status_select.js | |
parent | bba020a56cbedd6403b637ec7f9eaee258eb7c67 (diff) | |
download | gitlab-ce-430131f720187772f46e776a100273aba0d13aa6.tar.gz |
Remove issue and issue status select from global namespace
Diffstat (limited to 'app/assets/javascripts/issue_status_select.js')
-rw-r--r-- | app/assets/javascripts/issue_status_select.js | 58 |
1 files changed, 25 insertions, 33 deletions
diff --git a/app/assets/javascripts/issue_status_select.js b/app/assets/javascripts/issue_status_select.js index 56cb536dcde..fabfd26e699 100644 --- a/app/assets/javascripts/issue_status_select.js +++ b/app/assets/javascripts/issue_status_select.js @@ -1,34 +1,26 @@ -/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, quotes, object-shorthand, no-unused-vars, no-shadow, one-var, one-var-declaration-per-line, comma-dangle, max-len */ -(function() { - this.IssueStatusSelect = (function() { - function IssueStatusSelect() { - $('.js-issue-status').each(function(i, el) { - var fieldName; - fieldName = $(el).data("field-name"); - return $(el).glDropdown({ - selectable: true, - fieldName: fieldName, - toggleLabel: (function(_this) { - return function(selected, el, instance) { - var $item, label; - label = 'Author'; - $item = instance.dropdown.find('.is-active'); - if ($item.length) { - label = $item.text(); - } - return label; - }; - })(this), - clicked: function(options) { - return options.e.preventDefault(); - }, - id: function(obj, el) { - return $(el).data("id"); +/* eslint-disable func-names,wrap-iife, no-shadow, no-unused-vars, one-var */ +export default function issueStatusSelect() { + $('.js-issue-status').each(function (i, el) { + const fieldName = $(el).data('field-name'); + return $(el).glDropdown({ + selectable: true, + fieldName, + toggleLabel: (function (_this) { + return function (selected, el, instance) { + let label = 'Author'; + const $item = instance.dropdown.find('.is-active'); + if ($item.length) { + label = $item.text(); } - }); - }); - } - - return IssueStatusSelect; - })(); -}).call(window); + return label; + }; + })(this), + clicked(options) { + return options.e.preventDefault(); + }, + id(obj, el) { + return $(el).data('id'); + }, + }); + }); +} |