Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
293ac927
Commit
293ac927
authored
Oct 24, 2014
by
zubair-arbi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show warning on navigate away from import page only for first two stages
TNL-554
parent
3185dc48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
cms/static/js/factories/import.js
+4
-1
cms/static/js/views/import.js
+5
-0
No files found.
cms/static/js/factories/import.js
View file @
293ac927
...
...
@@ -28,6 +28,7 @@ define([
autoUpload
:
false
,
add
:
function
(
e
,
data
)
{
CourseImport
.
clearImportDisplay
();
CourseImport
.
okayToNavigateAway
=
false
;
submitBtn
.
unbind
(
'click'
);
file
=
data
.
files
[
0
];
if
(
file
.
name
.
match
(
/tar
\.
gz$/
))
{
...
...
@@ -97,7 +98,9 @@ define([
},
start
:
function
(
event
)
{
window
.
onbeforeunload
=
function
()
{
return
gettext
(
'Your import is in progress; navigating away will abort it.'
);
if
(
!
CourseImport
.
okayToNavigateAway
)
{
return
"${_('Your import is in progress; navigating away will abort it.')}"
;
}
};
},
sequentialUploads
:
true
,
...
...
cms/static/js/views/import.js
View file @
293ac927
...
...
@@ -49,6 +49,7 @@ define(
*/
var
getStatus
=
function
(
url
,
timeout
,
stage
)
{
var
currentStage
=
stage
||
0
;
if
(
currentStage
>
1
)
{
CourseImport
.
okayToNavigateAway
=
true
;
}
if
(
CourseImport
.
stopGetStatus
)
{
return
;}
if
(
currentStage
===
4
)
{
...
...
@@ -87,6 +88,10 @@ define(
* progress.
*/
stopGetStatus
:
false
,
/**
* Whether its fine to navigate away while import is in progress
*/
okayToNavigateAway
:
false
,
/**
* Update DOM to set all stages as not-started (for retrying an upload that
...
...
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