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
81f2521c
Commit
81f2521c
authored
Sep 27, 2012
by
Tom Giannattasio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved collapsible functionality out of problem.html template and into display.coffee
parent
e08124c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
36 deletions
+20
-36
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+18
-0
lms/templates/problem.html
+2
-36
No files found.
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
81f2521c
...
@@ -26,6 +26,13 @@ class @Problem
...
@@ -26,6 +26,13 @@ class @Problem
@
$
(
'section.action input.show'
).
click
@
show
@
$
(
'section.action input.show'
).
click
@
show
@
$
(
'section.action input.save'
).
click
@
save
@
$
(
'section.action input.save'
).
click
@
save
# Collapsibles
@
$
(
'.longform'
).
hide
();
@
$
(
'.shortform'
).
append
(
'<a href="#" class="full">See full output</a>'
);
@
$
(
'.collapsible section'
).
hide
();
@
$
(
'.full'
).
click
@
toggleFull
@
$
(
'.collapsible header a'
).
click
@
toggleHint
# Dynamath
# Dynamath
@
$
(
'input.math'
).
keyup
(
@
refreshMath
)
@
$
(
'input.math'
).
keyup
(
@
refreshMath
)
@
$
(
'input.math'
).
each
(
index
,
element
)
=>
@
$
(
'input.math'
).
each
(
index
,
element
)
=>
...
@@ -333,6 +340,17 @@ class @Problem
...
@@ -333,6 +340,17 @@ class @Problem
element
.
CodeMirror
.
save
()
if
element
.
CodeMirror
.
save
element
.
CodeMirror
.
save
()
if
element
.
CodeMirror
.
save
@
answers
=
@
inputs
.
serialize
()
@
answers
=
@
inputs
.
serialize
()
toggleFull
:
=>
$
(
event
.
target
).
parent
().
siblings
().
slideToggle
()
$
(
event
.
target
).
parent
().
parent
().
toggleClass
(
'open'
)
text
=
$
(
event
.
target
).
text
()
==
'See full output'
?
'Hide output'
:
'See full output'
$
(
this
).
text
(
text
)
toggleHint
:
(
event
)
=>
event
.
preventDefault
()
$
(
event
.
target
).
parent
().
siblings
().
slideToggle
()
$
(
event
.
target
).
parent
().
parent
().
toggleClass
(
'open'
)
inputtypeSetupMethods
:
inputtypeSetupMethods
:
'text-input-dynamath'
:
(
element
)
=>
'text-input-dynamath'
:
(
element
)
=>
...
...
lms/templates/problem.html
View file @
81f2521c
...
@@ -30,38 +30,4 @@
...
@@ -30,38 +30,4 @@
</section>
</section>
% endif
% endif
</section>
</section>
</section>
</section>
\ No newline at end of file
<
%
block
name=
"js_extra"
>
<script
type=
"text/javascript"
charset=
"utf-8"
>
var
collapsibleSet
;
$
(
function
(){
// this should be brought back into problems
$
(
'.longform'
).
hide
();
$
(
'.shortform'
).
append
(
'<a href="#" class="full">See full output</a>'
);
$
(
'.collapsible section'
).
hide
();
$
(
'.full'
).
click
(
function
()
{
$
(
this
).
parent
().
siblings
().
slideToggle
();
$
(
this
).
parent
().
parent
().
toggleClass
(
'open'
);
var
text
=
$
(
this
).
text
()
==
'See full output'
?
'Hide output'
:
'See full output'
;
$
(
this
).
text
(
text
);
return
false
;
});
function
toggleHint
(
e
)
{
e
.
preventDefault
();
$
(
this
).
parent
().
siblings
().
slideToggle
();
$
(
this
).
parent
().
parent
().
toggleClass
(
'open'
);
return
false
;
}
if
(
!
collapsibleSet
)
{
collapsibleSet
=
true
;
$
(
'body'
).
delegate
(
'.collapsible header a'
,
'click'
,
toggleHint
);
}
});
</script>
</
%
block>
\ No newline at end of file
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