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
b8da1c5b
Commit
b8da1c5b
authored
Feb 05, 2014
by
Adam Palay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If unit display name is non-empty string, change it to a defaul (STUD-1284)
parent
235d10dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
cms/static/coffee/src/views/unit.coffee
+7
-1
No files found.
cms/static/coffee/src/views/unit.coffee
View file @
b8da1c5b
...
@@ -271,7 +271,10 @@ define ["jquery", "jquery.ui", "gettext", "backbone",
...
@@ -271,7 +271,10 @@ define ["jquery", "jquery.ui", "gettext", "backbone",
@
$spinner
=
$
(
'<span class="spinner-in-field-icon"></span>'
);
@
$spinner
=
$
(
'<span class="spinner-in-field-icon"></span>'
);
render
:
=>
render
:
=>
@
$
(
'.unit-display-name-input'
).
val
(
@
model
.
get
(
'metadata'
).
display_name
)
display_name
=
@
model
.
get
(
'metadata'
).
display_name
if
not
display_name
:
display_name
=
gettext
'[Untitled]'
@
$
(
'.unit-display-name-input'
).
val
(
display_name
)
setEnabled
:
=>
setEnabled
:
=>
disabled
=
@
model
.
get
(
'state'
)
==
'public'
disabled
=
@
model
.
get
(
'state'
)
==
'public'
...
@@ -285,6 +288,9 @@ define ["jquery", "jquery.ui", "gettext", "backbone",
...
@@ -285,6 +288,9 @@ define ["jquery", "jquery.ui", "gettext", "backbone",
metadata
=
$
.
extend
({},
@
model
.
get
(
'metadata'
))
metadata
=
$
.
extend
({},
@
model
.
get
(
'metadata'
))
metadata
.
display_name
=
@
$
(
'.unit-display-name-input'
).
val
()
metadata
.
display_name
=
@
$
(
'.unit-display-name-input'
).
val
()
@
model
.
save
(
metadata
:
metadata
)
@
model
.
save
(
metadata
:
metadata
)
display_name
=
metadata
.
display_name
if
not
display_name
:
display_name
=
gettext
'[Untitled]'
# Update name shown in the right-hand side location summary.
# Update name shown in the right-hand side location summary.
$
(
'.unit-location .editing .unit-name'
).
html
(
metadata
.
display_name
)
$
(
'.unit-location .editing .unit-name'
).
html
(
metadata
.
display_name
)
analytics
.
track
"Edited Unit Name"
,
analytics
.
track
"Edited Unit Name"
,
...
...
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