diff options
author | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-05-28 14:05:40 +0300 |
---|---|---|
committer | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-05-28 14:05:40 +0300 |
commit | 778e9d90da9ccc7a4b79860a98e84356dd3adaf2 (patch) | |
tree | dbe789ff4e7c655ed808da8616b716fc2b4f6e55 /app/assets/javascripts/group_label_subscription.js | |
parent | e56c0a4763c5b1718bbaace8cd8189f1cbf27a2f (diff) |
Fix tooltips
Diffstat (limited to 'app/assets/javascripts/group_label_subscription.js')
-rw-r--r-- | app/assets/javascripts/group_label_subscription.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/group_label_subscription.js b/app/assets/javascripts/group_label_subscription.js index 5648cb9a888..a0716cdfdbe 100644 --- a/app/assets/javascripts/group_label_subscription.js +++ b/app/assets/javascripts/group_label_subscription.js @@ -35,6 +35,7 @@ export default class GroupLabelSubscription { this.$unsubscribeButtons.attr('data-url', url); axios.post(url) + .then(() => GroupLabelSubscription.setNewTooltip($btn)) .then(() => this.toggleSubscriptionButtons()) .catch(() => flash(__('There was an error when subscribing to this label.'))); } @@ -44,4 +45,14 @@ export default class GroupLabelSubscription { this.$subscribeButtons.toggleClass('hidden'); this.$unsubscribeButtons.toggleClass('hidden'); } + + static setNewTooltip($button) { + if (!$button.hasClass('js-subscribe-button')) return; + + const type = $button.hasClass('js-group-level') ? 'group' : 'project'; + const title = `Unsubscribe at ${type} level`; + const $unsubscribeButton = $('.js-unsubscribe-button', $button.closest('.label-actions-list')); + + $unsubscribeButton.tooltip('hide').attr('title', title).tooltip('fixTitle'); + } } |