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
64adb62d
Commit
64adb62d
authored
Jun 11, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure to save textbook name when it changes
parent
ce26d524
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
cms/templates/js/textbook-edit.underscore
+1
-1
cms/templates/textbooks.html
+8
-4
No files found.
cms/templates/js/textbook-edit.underscore
View file @
64adb62d
...
...
@@ -8,7 +8,7 @@
<legend class="sr"><%= gettext("Textbook information") %></legend>
<div class="input-wrap field text required add-textbook-name">
<label for="textbook-name-input"><%= gettext("Textbook Name") %></label>
<input id="textbook-name-input" type="text" placeholder="<%= gettext("Introduction to Cookie Baking") %>" value="<%= name %>">
<input id="textbook-name-input"
name="textbook-name"
type="text" placeholder="<%= gettext("Introduction to Cookie Baking") %>" value="<%= name %>">
<span class="tip tip-stacked"><%= gettext("the title/name of the text book as you would like your students to see it.") %></span>
</div>
</fieldset>
...
...
cms/templates/textbooks.html
View file @
64adb62d
...
...
@@ -120,6 +120,7 @@ CMS.Views.TextbookEdit = Backbone.View.extend({
return
this
;
},
events
:
{
"change input[name=textbook-name]"
:
"setName"
,
"submit"
:
"setAndClose"
,
"click .action-cancel"
:
"cancel"
,
"click .action-add-chapter"
:
"createChapter"
...
...
@@ -137,12 +138,15 @@ CMS.Views.TextbookEdit = Backbone.View.extend({
this
.
setValues
();
this
.
model
.
get
(
'chapters'
).
add
([{}]);
},
setName
:
function
(
e
)
{
if
(
e
&&
e
.
preventDefault
)
{
e
.
preventDefault
();
}
this
.
model
.
set
(
"name"
,
this
.
$
(
"#textbook-name-input"
).
val
(),
{
silent
:
true
});
},
setValues
:
function
()
{
var
name
=
this
.
$
(
"#textbook-name-input"
).
val
();
var
textbook
=
this
.
model
;
textbook
.
set
(
"name"
,
name
);
this
.
setName
();
var
that
=
this
;
_
.
each
(
this
.
$
(
"li"
),
function
(
li
,
i
)
{
var
chapter
=
t
extbook
.
get
(
'chapters'
).
at
(
i
);
var
chapter
=
t
hat
.
model
.
get
(
'chapters'
).
at
(
i
);
chapter
.
set
({
"name"
:
$
(
".chapter-name"
,
li
).
val
(),
"asset_path"
:
$
(
".chapter-asset-path"
,
li
).
val
()
...
...
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