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
f16efbb2
Commit
f16efbb2
authored
Mar 07, 2014
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't close modal on click outside new course update modal.
STUD-1404
parent
2a149a8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
cms/static/coffee/spec/views/course_info_spec.coffee
+15
-2
cms/static/js/views/course_info_update.js
+1
-1
No files found.
cms/static/coffee/spec/views/course_info_spec.coffee
View file @
f16efbb2
...
...
@@ -65,6 +65,19 @@ define ["js/views/course_info_handout", "js/views/course_info_update", "js/model
previewContents
=
@
courseInfoEdit
.
$el
.
find
(
'.update-contents'
).
html
()
expect
(
previewContents
).
not
.
toEqual
(
'unsaved changes'
)
@
doNotCloseNewCourseInfo
=
()
->
@
courseInfoEdit
.
onNew
(
@
event
)
spyOn
(
@
courseInfoEdit
.
$modalCover
,
'hide'
).
andCallThrough
()
spyOn
(
@
courseInfoEdit
.
$codeMirror
,
'getValue'
).
andReturn
(
'unsaved changes'
)
model
=
@
collection
.
at
(
0
)
spyOn
(
model
,
"save"
).
andCallThrough
()
cancelEditingUpdate
(
@
courseInfoEdit
,
@
courseInfoEdit
.
$modalCover
,
false
)
expect
(
model
.
save
).
not
.
toHaveBeenCalled
()
expect
(
@
courseInfoEdit
.
$modalCover
.
hide
).
not
.
toHaveBeenCalled
()
@
cancelExistingCourseInfo
=
(
useCancelButton
)
->
@
createNewUpdate
(
'existing update'
)
@
courseInfoEdit
.
$el
.
find
(
'.edit-button'
).
click
()
...
...
@@ -125,8 +138,8 @@ define ["js/views/course_info_handout", "js/views/course_info_update", "js/model
it
"removes newly created course info on cancel"
,
->
@
cancelNewCourseInfo
(
true
)
it
"
removes newly created
course info on click outside modal"
,
->
@
cancelNewCourseInfo
(
false
)
it
"
do not close new
course info on click outside modal"
,
->
@
doNotCloseNewCourseInfo
(
)
it
"does not remove existing course info on cancel"
,
->
@
cancelExistingCourseInfo
(
true
)
...
...
cms/static/js/views/course_info_update.js
View file @
f16efbb2
...
...
@@ -64,7 +64,7 @@ define(["js/views/baseview", "underscore", "codemirror", "js/models/course_updat
// Variable stored for unit test.
this
.
$modalCover
=
ModalUtils
.
showModalCover
(
false
,
function
()
{
self
.
closeEditor
(
true
)
// Binding empty function to prevent default hideModal.
});
$
(
'.date'
).
datepicker
(
'destroy'
);
...
...
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