diff options
author | Paul <paul@bonaud.fr> | 2018-04-17 13:11:19 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-04-17 13:11:19 +0000 |
commit | c34268c8de17541e0e5b4c3e66aecf099dd57202 (patch) | |
tree | b818689d84167d7e1dfdf276fd28b5321c46aa47 /app/assets/javascripts/branches | |
parent | dd557c464962412339c48d0538ec6fff0e82541c (diff) | |
download | gitlab-ce-c34268c8de17541e0e5b4c3e66aecf099dd57202.tar.gz |
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.js | 11 |
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(''); |