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
a1f3db77
Commit
a1f3db77
authored
Mar 01, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue showing edit dialog until saving is complete to allow user to correct validation errors.
parent
c4401fdc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
cms/static/coffee/src/xblock/cms.runtime.v1.coffee
+14
-8
No files found.
cms/static/coffee/src/xblock/cms.runtime.v1.coffee
View file @
a1f3db77
...
@@ -20,6 +20,10 @@ define [
...
@@ -20,6 +20,10 @@ define [
super
()
super
()
@
savingNotification
=
new
NotificationView
.
Mini
@
savingNotification
=
new
NotificationView
.
Mini
title
:
gettext
(
'Saving…'
)
title
:
gettext
(
'Saving…'
)
@
alert
=
new
NotificationView
.
Error
title
:
"OpenAssessment Save Error"
,
closeIcon
:
false
,
shown
:
false
handlerUrl
:
(
element
,
handlerName
,
suffix
,
query
,
thirdparty
)
->
handlerUrl
:
(
element
,
handlerName
,
suffix
,
query
,
thirdparty
)
->
uri
=
URI
(
"/xblock"
).
segment
(
$
(
element
).
data
(
'usage-id'
))
uri
=
URI
(
"/xblock"
).
segment
(
$
(
element
).
data
(
'usage-id'
))
...
@@ -41,11 +45,15 @@ define [
...
@@ -41,11 +45,15 @@ define [
# Starting to save, so show the "Saving..." notification
# Starting to save, so show the "Saving..." notification
if
data
.
state
==
'start'
if
data
.
state
==
'start'
@
_hideEditor
()
@
savingNotification
.
show
()
@
savingNotification
.
show
()
# Finished saving, so hide the "Saving..." notification
# Finished saving, so hide the "Saving..." notification
else
if
data
.
state
==
'end'
else
if
data
.
state
==
'end'
# Hide the editor *after* we finish saving in case there are validation
# errors that the user needs to correct.
@
_hideEditor
()
$
(
'.component.editing'
).
removeClass
(
'editing'
)
$
(
'.component.editing'
).
removeClass
(
'editing'
)
@
savingNotification
.
hide
()
@
savingNotification
.
hide
()
...
@@ -54,7 +62,8 @@ define [
...
@@ -54,7 +62,8 @@ define [
else
if
name
==
'error'
else
if
name
==
'error'
if
'msg'
of
data
if
'msg'
of
data
@
_showAlert
(
data
.
msg
)
@
alert
.
options
.
message
=
data
.
msg
@
alert
.
show
()
_hideEditor
:
()
->
_hideEditor
:
()
->
# This will close all open component editors, which works
# This will close all open component editors, which works
...
@@ -64,9 +73,6 @@ define [
...
@@ -64,9 +73,6 @@ define [
el
.
find
(
'.component-editor'
).
slideUp
(
150
)
el
.
find
(
'.component-editor'
).
slideUp
(
150
)
ModalUtils
.
hideModalCover
()
ModalUtils
.
hideModalCover
()
_showAlert
:
(
msg
)
->
# Hide any alerts that are being shown
new
NotificationView
.
Error
({
if
@
alert
.
options
.
shown
title
:
"OpenAssessment Save Error"
,
@
alert
.
hide
()
message
:
msg
,
closeIcon
:
false
}).
show
()
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