diff options
author | Phil Hughes <me@iamphill.com> | 2018-12-14 11:16:07 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-12-14 11:16:07 +0300 |
commit | 72feadce537f0f087ef5c2653222af9b68ab90f9 (patch) | |
tree | 73aed213a994a6a087c2f87e89526d791d1726e3 /app | |
parent | 91855866ebe404b26ff12fa031390111273a1af1 (diff) | |
parent | 5ee5203d6043807f28cca30c8358c0f0885bb305 (diff) |
Merge branch '55344-only-prompt-user-once-when-navigating-away-from-file-editor' into 'master'
Resolve "Only prompt user once when navigating away from file editor"
Closes #55344
See merge request gitlab-org/gitlab-ce!23820
Diffstat (limited to 'app')
-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; |