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
2ab05689
Commit
2ab05689
authored
Sep 29, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jsloader works at module-level
parent
ef2c8d0b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+1
-1
common/lib/xmodule/xmodule/js/src/jsloader.coffee
+9
-9
No files found.
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
2ab05689
...
@@ -27,7 +27,7 @@ class @Problem
...
@@ -27,7 +27,7 @@ class @Problem
@
$
(
'section.action input.save'
).
click
@
save
@
$
(
'section.action input.save'
).
click
@
save
# Collapsibles
# Collapsibles
JavascriptLoader
.
setCollapsibles
()
JavascriptLoader
.
setCollapsibles
(
@
el
)
# Dynamath
# Dynamath
@
$
(
'input.math'
).
keyup
(
@
refreshMath
)
@
$
(
'input.math'
).
keyup
(
@
refreshMath
)
...
...
common/lib/xmodule/xmodule/js/src/jsloader.coffee
View file @
2ab05689
...
@@ -3,14 +3,15 @@ class @JavascriptLoader
...
@@ -3,14 +3,15 @@ class @JavascriptLoader
Set of library functions that provide common interface for javascript loading
Set of library functions that provide common interface for javascript loading
for all module types
for all module types
###
###
@
setCollapsibles
:
()
=>
@
setCollapsibles
:
(
el
)
=>
console
.
log
(
$
(
'.collapsible section'
))
###
$
(
'.longform'
).
hide
();
el: jQuery object representing xmodule
$
(
'.shortform'
).
append
(
'<a href="#" class="full">See full output</a>'
);
###
$
(
'.collapsible section'
).
hide
();
el
.
find
(
'.longform'
).
hide
();
$
(
'.full'
).
click
@
toggleFull
el
.
find
(
'.shortform'
).
append
(
'<a href="#" class="full">See full output</a>'
);
$
(
'.collapsible header a'
).
click
@
toggleHint
el
.
find
(
'.collapsible section'
).
hide
();
@
toggleHint
()
el
.
find
(
'.full'
).
click
@
toggleFull
el
.
find
(
'.collapsible header a'
).
click
@
toggleHint
@
toggleFull
:
(
event
)
=>
@
toggleFull
:
(
event
)
=>
$
(
event
.
target
).
parent
().
siblings
().
slideToggle
()
$
(
event
.
target
).
parent
().
siblings
().
slideToggle
()
...
@@ -19,7 +20,6 @@ class @JavascriptLoader
...
@@ -19,7 +20,6 @@ class @JavascriptLoader
$
(
this
).
text
(
text
)
$
(
this
).
text
(
text
)
@
toggleHint
:
(
event
)
=>
@
toggleHint
:
(
event
)
=>
console
.
log
(
'toggleHint'
)
event
.
preventDefault
()
event
.
preventDefault
()
$
(
event
.
target
).
parent
().
siblings
().
slideToggle
()
$
(
event
.
target
).
parent
().
siblings
().
slideToggle
()
$
(
event
.
target
).
parent
().
parent
().
toggleClass
(
'open'
)
$
(
event
.
target
).
parent
().
parent
().
toggleClass
(
'open'
)
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