Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DoneXBlock
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
DoneXBlock
Commits
604a79dc
Commit
604a79dc
authored
May 30, 2014
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Multiple per page works
parent
2aa07457
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
done/done.py
+5
-2
done/static/js/src/done.js
+11
-5
No files found.
done/done.py
View file @
604a79dc
...
@@ -63,9 +63,11 @@ class DoneXBlock(XBlock):
...
@@ -63,9 +63,11 @@ class DoneXBlock(XBlock):
if
self
.
align
.
lower
()
==
"right"
:
if
self
.
align
.
lower
()
==
"right"
:
grow_right
=
0
grow_right
=
0
frag
.
add_css
(
".done_left_spacer {{ flex-grow:{l}; }} .done_right_spacer {{ flex-grow:{r}; }}"
.
format
(
r
=
grow_right
,
l
=
grow_left
))
frag
.
add_css
(
".done_left_spacer {{ flex-grow:{l}; }} .done_right_spacer {{ flex-grow:{r}; }}"
.
format
(
r
=
grow_right
,
l
=
grow_left
))
frag
.
add_javascript
(
"var done_done = "
+
(
"true"
if
self
.
done
else
"false"
)
+
";"
)
frag
.
add_javascript
(
self
.
resource_string
(
"static/js/src/done.js"
))
frag
.
add_javascript
(
self
.
resource_string
(
"static/js/src/done.js"
))
frag
.
initialize_js
(
'DoneXBlock'
)
if
self
.
done
:
frag
.
initialize_js
(
"DoneXBlockOn"
)
else
:
frag
.
initialize_js
(
"DoneXBlockOff"
)
return
frag
return
frag
# TO-DO: change this to create the scenarios you'd like to see in the
# TO-DO: change this to create the scenarios you'd like to see in the
...
@@ -77,6 +79,7 @@ class DoneXBlock(XBlock):
...
@@ -77,6 +79,7 @@ class DoneXBlock(XBlock):
(
"DoneXBlock"
,
(
"DoneXBlock"
,
"""<vertical_demo>
"""<vertical_demo>
<done align="left"> </done>
<done align="left"> </done>
<done align="left"> </done>
</vertical_demo>
</vertical_demo>
"""
),
"""
),
]
]
...
...
done/static/js/src/done.js
View file @
604a79dc
function
DoneXBlockOn
(
runtime
,
element
)
{
$
(
'.done_windshield'
,
element
).
addClass
(
"done_windshield_off"
).
removeClass
(
"done_windshield_on"
);
DoneXBlock
(
runtime
,
element
);
}
function
DoneXBlockOff
(
runtime
,
element
)
{
console
.
log
(
"b"
);
$
(
'.done_windshield'
,
element
).
addClass
(
"done_windshield_on"
).
removeClass
(
"done_windshield_off"
);
DoneXBlock
(
runtime
,
element
);
}
function
DoneXBlock
(
runtime
,
element
)
{
function
DoneXBlock
(
runtime
,
element
)
{
var
handlerUrl
=
runtime
.
handlerUrl
(
element
,
'toggle_button'
);
var
handlerUrl
=
runtime
.
handlerUrl
(
element
,
'toggle_button'
);
function
updateCount
(
result
)
{}
function
updateCount
(
result
)
{}
$
(
function
(
$
)
{
$
(
function
(
$
)
{
if
(
done_done
)
{
$
(
'.done_windshield'
,
element
).
addClass
(
"done_windshield_off"
).
removeClass
(
"done_windshield_on"
);
}
else
{
$
(
'.done_windshield'
,
element
).
addClass
(
"done_windshield_on"
).
removeClass
(
"done_windshield_off"
);
}
// Don't have animations on for above class changes. This is probably not necessary. I
// Don't have animations on for above class changes. This is probably not necessary. I
// was seeing animations on page load. I did a few things to fix it. The line below
// was seeing animations on page load. I did a few things to fix it. The line below
// wasn't the one that fixed it, but I decided to keep it anyways.
// wasn't the one that fixed it, but I decided to keep it anyways.
...
...
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