diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-10-10 02:13:34 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-10-16 13:01:19 -0500 |
commit | c559bcca03a83db3e6ce66d4ae3cd98f8b9d1cb0 (patch) | |
tree | c0b88650027f5d2091baba92007f86605dee9817 /app/assets/javascripts/project_label_subscription.js | |
parent | aeaf6686df0dabd211221b1158586136707f3bdf (diff) | |
download | gitlab-ce-c559bcca03a83db3e6ce66d4ae3cd98f8b9d1cb0.tar.gz |
Prettify additional modules (I through Z)
Diffstat (limited to 'app/assets/javascripts/project_label_subscription.js')
-rw-r--r-- | app/assets/javascripts/project_label_subscription.js | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/app/assets/javascripts/project_label_subscription.js b/app/assets/javascripts/project_label_subscription.js index 9049f87e037..d3c604dcee1 100644 --- a/app/assets/javascripts/project_label_subscription.js +++ b/app/assets/javascripts/project_label_subscription.js @@ -31,32 +31,35 @@ export default class ProjectLabelSubscription { $btn.addClass('disabled'); - axios.post(url).then(() => { - let newStatus; - let newAction; + axios + .post(url) + .then(() => { + let newStatus; + let newAction; - if (oldStatus === 'unsubscribed') { - [newStatus, newAction] = ['subscribed', 'Unsubscribe']; - } else { - [newStatus, newAction] = ['unsubscribed', 'Subscribe']; - } + if (oldStatus === 'unsubscribed') { + [newStatus, newAction] = ['subscribed', 'Unsubscribe']; + } else { + [newStatus, newAction] = ['unsubscribed', 'Subscribe']; + } - $btn.removeClass('disabled'); + $btn.removeClass('disabled'); - this.$buttons.attr('data-status', newStatus); - this.$buttons.find('> span').text(newAction); + this.$buttons.attr('data-status', newStatus); + this.$buttons.find('> span').text(newAction); - this.$buttons.map((i, button) => { - const $button = $(button); - const originalTitle = $button.attr('data-original-title'); + this.$buttons.map((i, button) => { + const $button = $(button); + const originalTitle = $button.attr('data-original-title'); - if (originalTitle) { - ProjectLabelSubscription.setNewTitle($button, originalTitle, newStatus, newAction); - } + if (originalTitle) { + ProjectLabelSubscription.setNewTitle($button, originalTitle, newStatus, newAction); + } - return button; - }); - }).catch(() => flash(__('There was an error subscribing to this label.'))); + return button; + }); + }) + .catch(() => flash(__('There was an error subscribing to this label.'))); } static setNewTitle($button, originalTitle, newStatus) { |