summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 06:07:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 06:07:06 +0000
commit3546e1bb0971347e9e9984de0799e3fb53743b33 (patch)
treef65e47d5deb95905aa419ebd70ce02c7b32ddb8f /app/assets
parentf155cc9034f2247c5d368f9b0212ad44248b0c5e (diff)
downloadgitlab-ce-3546e1bb0971347e9e9984de0799e3fb53743b33.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/labels_select.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js
index 22b062563b5..72de3b5d726 100644
--- a/app/assets/javascripts/labels_select.js
+++ b/app/assets/javascripts/labels_select.js
@@ -32,6 +32,7 @@ export default class LabelsSelect {
$selectbox,
$sidebarCollapsedValue,
$value,
+ $dropdownMenu,
abilityName,
defaultLabel,
issueUpdateURL,
@@ -67,6 +68,7 @@ export default class LabelsSelect {
$sidebarCollapsedValue = $block.find('.sidebar-collapsed-icon span');
$sidebarLabelTooltip = $block.find('.js-sidebar-labels-tooltip');
$value = $block.find('.value');
+ $dropdownMenu = $dropdown.parent().find('.dropdown-menu');
$loading = $block.find('.block-loading').fadeOut();
fieldName = $dropdown.data('fieldName');
initialSelected = $selectbox
@@ -454,9 +456,21 @@ export default class LabelsSelect {
}
$loading.fadeIn();
+ const oldLabels = boardsStore.detail.issue.labels;
boardsStore.detail.issue
.update($dropdown.attr('data-issue-update'))
+ .then(() => {
+ if (isScopedLabel(label)) {
+ const prevIds = oldLabels.map(label => label.id);
+ const newIds = boardsStore.detail.issue.labels.map(label => label.id);
+ const differentIds = _.difference(prevIds, newIds);
+ $dropdown.data('marked', newIds);
+ $dropdownMenu
+ .find(differentIds.map(id => `[data-label-id="${id}"]`).join(','))
+ .removeClass('is-active');
+ }
+ })
.then(fadeOutLoader)
.catch(fadeOutLoader);
} else if (handleClick) {