Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ee6d90b3
Commit
ee6d90b3
authored
Dec 14, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
bda2f7e0
72feadce
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
app/assets/javascripts/blob_edit/blob_bundle.js
app/assets/javascripts/blob_edit/blob_bundle.js
+5
-0
changelogs/unreleased/55344-only-prompt-user-once-when-navigating-away-from-file-editor.yml
...rompt-user-once-when-navigating-away-from-file-editor.yml
+5
-0
spec/javascripts/blob_edit/blob_bundle_spec.js
spec/javascripts/blob_edit/blob_bundle_spec.js
+7
-0
No files found.
app/assets/javascripts/blob_edit/blob_bundle.js
View file @
ee6d90b3
...
...
@@ -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
;
...
...
changelogs/unreleased/55344-only-prompt-user-once-when-navigating-away-from-file-editor.yml
0 → 100644
View file @
ee6d90b3
---
title
:
Only prompt user once when navigating away from file editor
merge_request
:
23820
author
:
Sam Bigelow
type
:
fixed
spec/javascripts/blob_edit/blob_bundle_spec.js
View file @
ee6d90b3
...
...
@@ -14,6 +14,7 @@ describe('EditBlob', () => {
setFixtures
(
`
<div class="js-edit-blob-form">
<button class="js-commit-button"></button>
<a class="btn btn-cancel" href="#"></a>
</div>`
);
blobBundle
();
});
...
...
@@ -27,4 +28,10 @@ describe('EditBlob', () => {
expect
(
window
.
onbeforeunload
).
toBeNull
();
});
it
(
'
removes beforeunload listener when cancel link is clicked
'
,
()
=>
{
$
(
'
.btn.btn-cancel
'
).
click
();
expect
(
window
.
onbeforeunload
).
toBeNull
();
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment