Commit 765795dc by Piotr Mitros

Using XBlocks args (note: no longer compatible with master on edx-platform --…

Using XBlocks args (note: no longer compatible with master on edx-platform -- use previous commit -- we're using this as a testcase for backporting xblocks args to edx-platform)
parent 193be7b2
......@@ -64,10 +64,7 @@ class DoneXBlock(XBlock):
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_javascript(self.resource_string("static/js/src/done.js"))
if self.done:
frag.initialize_js("DoneXBlockOn")
else:
frag.initialize_js("DoneXBlockOff")
frag.initialize_js("DoneXBlock", {'state':self.done})
return frag
# TO-DO: change this to create the scenarios you'd like to see in the
......
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, data) {
if (data.state) {
$('.done_windshield', element).addClass("done_windshield_off").removeClass("done_windshield_on");
} else {
$('.done_windshield', element).addClass("done_windshield_on").removeClass("done_windshield_off");
}
var handlerUrl = runtime.handlerUrl(element, 'toggle_button');
function updateCount(result) {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment