From 5ee5203d6043807f28cca30c8358c0f0885bb305 Mon Sep 17 00:00:00 2001 From: Sam Bigelow Date: Thu, 13 Dec 2018 16:27:23 -0500 Subject: Remove beforeunload listener for cancel button --- app/assets/javascripts/blob_edit/blob_bundle.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/assets/javascripts/blob_edit') 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; -- cgit v1.2.3