summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/subscription_select.js
diff options
context:
space:
mode:
authorMike Greiling <mgreiling@gitlab.com>2017-07-05 17:20:41 +0000
committerClement Ho <clemmakesapps@gmail.com>2017-07-05 17:20:41 +0000
commitc06dad62e1004eb5b4f2251a233f740d3fa2a5c2 (patch)
tree78346e13ce069442c662bb14e7b33bb607c3f2d6 /app/assets/javascripts/subscription_select.js
parent11e03bf49c9dfc220c29129498996d52cd4276e2 (diff)
downloadgitlab-ce-c06dad62e1004eb5b4f2251a233f740d3fa2a5c2.tar.gz
Remove IIFEs around several javascript classes
Diffstat (limited to 'app/assets/javascripts/subscription_select.js')
-rw-r--r--app/assets/javascripts/subscription_select.js61
1 files changed, 30 insertions, 31 deletions
diff --git a/app/assets/javascripts/subscription_select.js b/app/assets/javascripts/subscription_select.js
index 0cd591c7320..a48434181b6 100644
--- a/app/assets/javascripts/subscription_select.js
+++ b/app/assets/javascripts/subscription_select.js
@@ -1,34 +1,33 @@
/* 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.SubscriptionSelect = (function() {
- function SubscriptionSelect() {
- $('.js-subscription-event').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 = 'Subscription';
- $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");
- }
- });
+
+window.SubscriptionSelect = (function() {
+ function SubscriptionSelect() {
+ $('.js-subscription-event').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 = 'Subscription';
+ $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");
+ }
});
- }
+ });
+ }
- return SubscriptionSelect;
- })();
-}).call(window);
+ return SubscriptionSelect;
+})();