Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul <paul@bonaud.fr>2018-04-17 16:11:19 +0300
committerPhil Hughes <me@iamphill.com>2018-04-17 16:11:19 +0300
commitc34268c8de17541e0e5b4c3e66aecf099dd57202 (patch)
treeb818689d84167d7e1dfdf276fd28b5321c46aa47 /app/assets/javascripts/branches
parentdd557c464962412339c48d0538ec6fff0e82541c (diff)
Fix the input confirmation validation for the delete branches modal
Diffstat (limited to 'app/assets/javascripts/branches')
-rw-r--r--app/assets/javascripts/branches/branches_delete_modal.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/branches/branches_delete_modal.js b/app/assets/javascripts/branches/branches_delete_modal.js
index 839e369eaf6..f34496f84c6 100644
--- a/app/assets/javascripts/branches/branches_delete_modal.js
+++ b/app/assets/javascripts/branches/branches_delete_modal.js
@@ -16,6 +16,7 @@ class DeleteModal {
bindEvents() {
this.$toggleBtns.on('click', this.setModalData.bind(this));
this.$confirmInput.on('input', this.setDeleteDisabled.bind(this));
+ this.$deleteBtn.on('click', this.setDisableDeleteButton.bind(this));
}
setModalData(e) {
@@ -30,6 +31,16 @@ class DeleteModal {
this.$deleteBtn.attr('disabled', e.currentTarget.value !== this.branchName);
}
+ setDisableDeleteButton(e) {
+ if (this.$deleteBtn.is('[disabled]')) {
+ e.preventDefault();
+ e.stopPropagation();
+ return false;
+ }
+
+ return true;
+ }
+
updateModal() {
this.$branchName.text(this.branchName);
this.$confirmInput.val('');