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
5792e7e0
Commit
5792e7e0
authored
May 29, 2014
by
Andy Armstrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the title of edit modals from the unit page.
parent
b15f3f19
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
cms/static/js/spec/views/pages/container_spec.js
+2
-3
cms/static/js/spec/views/unit_spec.js
+4
-0
cms/static/js/spec_helpers/modal_helpers.js
+6
-0
cms/static/js/views/modals/edit_xblock.js
+4
-0
No files found.
cms/static/js/spec/views/pages/container_spec.js
View file @
5792e7e0
...
...
@@ -87,14 +87,13 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
});
it
(
'can edit itself'
,
function
()
{
var
editButtons
,
modalElement
,
var
editButtons
,
updatedTitle
=
'Updated Test Container'
;
renderContainerPage
(
mockContainerXBlockHtml
,
this
);
// Click the root edit button
editButtons
=
containerPage
.
$
(
'.nav-actions .edit-button'
);
editButtons
.
first
().
click
();
modalElement
=
edit_helpers
.
getModalElement
();
// Expect a request to be made to show the studio view for the container
expect
(
lastRequest
().
url
).
toBe
(
...
...
@@ -107,7 +106,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
expect
(
edit_helpers
.
isShowingModal
()).
toBeTruthy
();
// Expect the correct title to be shown
expect
(
modalElement
.
find
(
'.modal-window-title'
).
text
()).
toBe
(
'Editing: Test Container'
);
expect
(
edit_helpers
.
getModalTitle
()).
toBe
(
'Editing: Test Container'
);
// Press the save button and respond with a success message to the save
edit_helpers
.
pressModalButton
(
'.action-save'
);
...
...
cms/static/js/spec/views/unit_spec.js
View file @
5792e7e0
...
...
@@ -211,7 +211,11 @@ define(["jquery", "underscore", "jasmine", "coffee/src/views/unit", "js/models/m
html
:
mockXBlockEditorHtml
,
resources
:
[]
});
// Expect that a modal is shown with the correct title
expect
(
edit_helpers
.
isShowingModal
()).
toBeTruthy
();
expect
(
edit_helpers
.
getModalTitle
()).
toBe
(
'Editing: Test Child Container'
);
});
});
...
...
cms/static/js/spec_helpers/modal_helpers.js
View file @
5792e7e0
...
...
@@ -27,6 +27,11 @@ define(["jquery", "js/spec_helpers/view_helpers"],
return
modalElement
;
};
getModalTitle
=
function
(
modal
)
{
var
modalElement
=
getModalElement
(
modal
);
return
modalElement
.
find
(
'.modal-window-title'
).
text
();
};
isShowingModal
=
function
(
modal
)
{
var
modalElement
=
getModalElement
(
modal
);
return
modalElement
.
length
>
0
;
...
...
@@ -58,6 +63,7 @@ define(["jquery", "js/spec_helpers/view_helpers"],
return
$
.
extend
(
view_helpers
,
{
'getModalElement'
:
getModalElement
,
'getModalTitle'
:
getModalTitle
,
'installModalTemplates'
:
installModalTemplates
,
'isShowingModal'
:
isShowingModal
,
'hideModalIfShowing'
:
hideModalIfShowing
,
...
...
cms/static/js/views/modals/edit_xblock.js
View file @
5792e7e0
...
...
@@ -181,6 +181,10 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal",
if
(
xblockWrapperElement
.
length
>
0
)
{
xblockElement
=
xblockWrapperElement
.
find
(
'.xblock'
);
displayName
=
xblockWrapperElement
.
find
(
'.xblock-header .header-details'
).
text
().
trim
();
// If not found, try looking for the old unit page style rendering
if
(
!
displayName
)
{
displayName
=
this
.
xblockElement
.
find
(
'.component-header'
).
text
().
trim
();
}
xblockInfo
=
new
XBlockInfo
({
id
:
xblockWrapperElement
.
data
(
'locator'
),
courseKey
:
xblockWrapperElement
.
data
(
'course-key'
),
...
...
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