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
553eb53f
Commit
553eb53f
authored
Jun 28, 2012
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly hide the content when cancel
parent
9fcf098f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
cms/static/coffee/src/views/course.coffee
+7
-0
cms/static/coffee/src/views/module_edit.coffee
+7
-1
cms/static/coffee/src/views/week.coffee
+12
-3
No files found.
cms/static/coffee/src/views/course.coffee
View file @
553eb53f
...
...
@@ -4,6 +4,7 @@ class CMS.Views.Course extends Backbone.View
new
CMS
.
Views
.
Week
el
:
week
,
height
:
@
maxWeekHeight
()
CMS
.
on
(
'showContent'
,
@
showContent
)
CMS
.
on
(
'hideContent'
,
@
hideContent
)
showContent
:
(
subview
)
=>
$
(
'body'
).
addClass
(
'content'
)
...
...
@@ -11,6 +12,12 @@ class CMS.Views.Course extends Backbone.View
@
$
(
'.cal'
).
css
height
:
@
contentHeight
()
@
$
(
'>section'
).
css
minHeight
:
@
contentHeight
()
hideContent
:
=>
$
(
'body'
).
removeClass
(
'content'
)
@
$
(
'.main-content'
).
empty
()
@
$
(
'.cal'
).
css
height
:
''
@
$
(
'>section'
).
css
minHeight
:
''
maxWeekHeight
:
->
_
.
max
(
$
(
'#weeks > li'
).
map
->
$
(
this
).
height
())
+
1
...
...
cms/static/coffee/src/views/module_edit.coffee
View file @
553eb53f
...
...
@@ -2,6 +2,12 @@ class CMS.Views.ModuleEdit extends Backbone.View
tagName
:
'section'
className
:
'edit-pane'
events
:
'click .cancel'
:
'cancel'
initialize
:
->
CMS
.
trigger
'module.edit'
@
$el
.
append
(
$
(
'<div id="module-html">'
).
load
(
@
model
.
editUrl
()))
@
$el
.
append
(
$
(
"""<div id="
#{
@
model
.
get
(
'id'
)
}
">"""
).
load
(
@
model
.
editUrl
()))
cancel
:
->
CMS
.
trigger
'hideContent'
cms/static/coffee/src/views/week.coffee
View file @
553eb53f
...
...
@@ -3,13 +3,22 @@ class CMS.Views.Week extends Backbone.View
'click .module-edit'
:
'edit'
initialize
:
->
@
model
=
new
CMS
.
Models
.
Week
(
id
:
@
el
.
id
)
@
$el
.
height
@
options
.
height
@
model
=
new
CMS
.
Models
.
Week
(
id
:
@
$el
.
data
(
'id'
)
)
@
setHeight
()
@
$
(
'.editable'
).
inlineEdit
()
@
$
(
'.editable-textarea'
).
inlineEdit
(
control
:
'textarea'
)
@
$
(
'
#
modules .module'
).
each
->
@
$
(
'
.
modules .module'
).
each
->
new
CMS
.
Views
.
Module
el
:
this
CMS
.
on
(
'showContent'
,
@
resetHeight
)
CMS
.
on
(
'hideContent'
,
@
setHeight
)
edit
:
=>
CMS
.
trigger
(
'showContent'
,
new
CMS
.
Views
.
WeekEdit
(
model
:
@
model
))
setHeight
:
=>
@
$el
.
height
(
@
options
.
height
)
resetHeight
:
=>
@
$el
.
height
(
''
)
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