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
a86c84a4
Commit
a86c84a4
authored
Jul 05, 2012
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Backbone's `render` convention instead
parent
9cb24ccc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
cms/static/coffee/src/main.coffee
+1
-1
cms/static/coffee/src/views/course.coffee
+6
-4
cms/static/coffee/src/views/week.coffee
+6
-5
No files found.
cms/static/coffee/src/main.coffee
View file @
a86c84a4
...
...
@@ -5,7 +5,7 @@
viewStack
:
[]
start
:
->
new
CMS
.
Views
.
Course
el
:
$
(
'section.main-container'
)
new
CMS
.
Views
.
Course
(
el
:
$
(
'section.main-container'
)).
render
(
)
replaceView
:
(
view
)
->
@
viewStack
=
[
view
]
...
...
cms/static/coffee/src/views/course.coffee
View file @
a86c84a4
class
CMS
.
Views
.
Course
extends
Backbone
.
View
initialize
:
->
@
$
(
'#weeks > li'
).
each
(
index
,
week
)
=>
new
CMS
.
Views
.
Week
el
:
week
,
height
:
@
maxWeekHeight
()
CMS
.
on
(
'content.show'
,
@
showContent
)
CMS
.
on
(
'content.hide'
,
@
hideContent
)
render
:
->
@
$
(
'#weeks > li'
).
each
(
index
,
week
)
=>
new
CMS
.
Views
.
Week
(
el
:
week
,
height
:
@
maxWeekHeight
()).
render
()
return
@
showContent
:
(
subview
)
=>
$
(
'body'
).
addClass
(
'content'
)
@
$
(
'.main-content'
).
html
(
subview
.
el
)
@
$
(
'.main-content'
).
html
(
subview
.
render
().
el
)
@
$
(
'.cal'
).
css
height
:
@
contentHeight
()
@
$
(
'>section'
).
css
minHeight
:
@
contentHeight
()
...
...
cms/static/coffee/src/views/week.coffee
View file @
a86c84a4
...
...
@@ -3,15 +3,16 @@ class CMS.Views.Week extends Backbone.View
'click .week-edit'
:
'edit'
initialize
:
->
CMS
.
on
(
'content.show'
,
@
resetHeight
)
CMS
.
on
(
'content.hide'
,
@
setHeight
)
render
:
->
@
setHeight
()
@
$
(
'.editable'
).
inlineEdit
()
@
$
(
'.editable-textarea'
).
inlineEdit
(
control
:
'textarea'
)
@
$
(
'.modules .module'
).
each
->
new
CMS
.
Views
.
Module
el
:
this
CMS
.
on
(
'content.show'
,
@
resetHeight
)
CMS
.
on
(
'content.hide'
,
@
setHeight
)
new
CMS
.
Views
.
Module
(
el
:
this
).
render
()
return
@
edit
:
=>
CMS
.
replaceView
(
new
CMS
.
Views
.
WeekEdit
(
model
:
new
CMS
.
Models
.
Week
(
id
:
@
$el
.
data
(
'id'
))))
...
...
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