diff options
author | Sam Bigelow <sbigelow@gitlab.com> | 2018-12-14 00:27:23 +0300 |
---|---|---|
committer | Sam Bigelow <sbigelow@gitlab.com> | 2018-12-14 00:30:07 +0300 |
commit | 5ee5203d6043807f28cca30c8358c0f0885bb305 (patch) | |
tree | d8f1ff322020f4cce3eab152e596bb86a77158b0 /app/assets/javascripts | |
parent | 07e079e8dd336e76986ad001fce79ab9babb00b0 (diff) |
Remove beforeunload listener for cancel button
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/blob_edit/blob_bundle.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/assets/javascripts/blob_edit/blob_bundle.js b/app/assets/javascripts/blob_edit/blob_bundle.js index 9f547471170..b07f951346e 100644 --- a/app/assets/javascripts/blob_edit/blob_bundle.js +++ b/app/assets/javascripts/blob_edit/blob_bundle.js @@ -17,6 +17,11 @@ export default () => { const currentAction = $('.js-file-title').data('currentAction'); const projectId = editBlobForm.data('project-id'); const commitButton = $('.js-commit-button'); + const cancelLink = $('.btn.btn-cancel'); + + cancelLink.on('click', () => { + window.onbeforeunload = null; + }); commitButton.on('click', () => { window.onbeforeunload = null; |