summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/branches
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2017-09-15 12:33:50 +0000
committerPhil Hughes <me@iamphill.com>2017-09-15 12:33:50 +0000
commit72a30d613404ed9a77ad8062f311cac7aece0370 (patch)
tree87d180faa11b045dd9e98264b9679a20822ee6ee /app/assets/javascripts/branches
parent20295b3db379f4be02521cac591feca3452a2b1c (diff)
downloadgitlab-ce-72a30d613404ed9a77ad8062f311cac7aece0370.tar.gz
Display whether branch has been merged when deleting protected branch
Diffstat (limited to 'app/assets/javascripts/branches')
-rw-r--r--app/assets/javascripts/branches/branches_delete_modal.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/branches/branches_delete_modal.js b/app/assets/javascripts/branches/branches_delete_modal.js
index af8bcdc1794..cbc28374b80 100644
--- a/app/assets/javascripts/branches/branches_delete_modal.js
+++ b/app/assets/javascripts/branches/branches_delete_modal.js
@@ -7,6 +7,7 @@ class DeleteModal {
this.$branchName = $('.js-branch-name', this.$modal);
this.$confirmInput = $('.js-delete-branch-input', this.$modal);
this.$deleteBtn = $('.js-delete-branch', this.$modal);
+ this.$notMerged = $('.js-not-merged', this.$modal);
this.bindEvents();
}
@@ -16,8 +17,10 @@ class DeleteModal {
}
setModalData(e) {
- this.branchName = e.currentTarget.dataset.branchName || '';
- this.deletePath = e.currentTarget.dataset.deletePath || '';
+ const branchData = e.currentTarget.dataset;
+ this.branchName = branchData.branchName || '';
+ this.deletePath = branchData.deletePath || '';
+ this.isMerged = !!branchData.isMerged;
this.updateModal();
}
@@ -30,6 +33,7 @@ class DeleteModal {
this.$confirmInput.val('');
this.$deleteBtn.attr('href', this.deletePath);
this.$deleteBtn.attr('disabled', true);
+ this.$notMerged.toggleClass('hidden', this.isMerged);
}
}