diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2017-04-20 11:11:51 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-04-20 11:11:51 +0000 |
commit | d586b6cced34d663f018203e99aecbb9c6ac3158 (patch) | |
tree | dd01b08da4233d1b27762021fa9919a2708d12f9 /app/assets/javascripts/labels_select.js | |
parent | f96e1bf12432b0f4eff4a900caa46a0c4790123f (diff) | |
download | gitlab-ce-d586b6cced34d663f018203e99aecbb9c6ac3158.tar.gz |
Add ES lint support to identify poorly written Promises
Diffstat (limited to 'app/assets/javascripts/labels_select.js')
-rw-r--r-- | app/assets/javascripts/labels_select.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js index 443fb3e0ca9..9a60f5464df 100644 --- a/app/assets/javascripts/labels_select.js +++ b/app/assets/javascripts/labels_select.js @@ -332,6 +332,9 @@ vue: $dropdown.hasClass('js-issue-board-sidebar'), clicked: function(label, $el, e, isMarking) { var isIssueIndex, isMRIndex, page, boardsModel; + var fadeOutLoader = () => { + $loading.fadeOut(); + }; page = $('body').data('page'); isIssueIndex = page === 'projects:issues:index'; @@ -396,9 +399,8 @@ $loading.fadeIn(); gl.issueBoards.BoardsStore.detail.issue.update($dropdown.attr('data-issue-update')) - .then(function () { - $loading.fadeOut(); - }); + .then(fadeOutLoader) + .catch(fadeOutLoader); } else { if ($dropdown.hasClass('js-multiselect')) { |