summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/label_manager.js
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-04-12 18:54:23 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-04-19 14:17:36 +0800
commit0866a47a349cb89bb0d18eb2347055b1cdcba026 (patch)
treea93f188c013f5ab9d8f37765702a74058faf634c /app/assets/javascripts/label_manager.js
parent9ec37d3dc1c1969be743a0c283242dc462a8f466 (diff)
downloadgitlab-ce-0866a47a349cb89bb0d18eb2347055b1cdcba026.tar.gz
Show prioritized labels to guests57247-show-prioritized-labels-to-guests
Disables sorting when guests are viewing
Diffstat (limited to 'app/assets/javascripts/label_manager.js')
-rw-r--r--app/assets/javascripts/label_manager.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/app/assets/javascripts/label_manager.js b/app/assets/javascripts/label_manager.js
index f134a54dd53..4d304c5fe69 100644
--- a/app/assets/javascripts/label_manager.js
+++ b/app/assets/javascripts/label_manager.js
@@ -14,13 +14,16 @@ export default class LabelManager {
this.errorMessage = 'Unable to update label prioritization at this time';
this.emptyState = document.querySelector('#js-priority-labels-empty-state');
this.$badgeItemTemplate = $('#js-badge-item-template');
- this.sortable = Sortable.create(this.prioritizedLabels.get(0), {
- filter: '.empty-message',
- forceFallback: true,
- fallbackClass: 'is-dragging',
- dataIdAttr: 'data-id',
- onUpdate: this.onPrioritySortUpdate.bind(this),
- });
+
+ if ('sortable' in this.prioritizedLabels.data()) {
+ Sortable.create(this.prioritizedLabels.get(0), {
+ filter: '.empty-message',
+ forceFallback: true,
+ fallbackClass: 'is-dragging',
+ dataIdAttr: 'data-id',
+ onUpdate: this.onPrioritySortUpdate.bind(this),
+ });
+ }
this.bindEvents();
}