Commit 77af8604 by kimth

Begin transplant of executeProblemScripts

parent 8956e5bc
......@@ -77,6 +77,10 @@ class @Problem
render: (content) ->
if content
@el.html(content)
JavascriptLoader.executeModuleScripts @el, () =>
@setupInputTypes()
@bind()
@queueing()
@executeProblemScripts () =>
@setupInputTypes()
@bind()
......@@ -84,6 +88,10 @@ class @Problem
else
$.postWithPrefix "#{@url}/problem_get", (response) =>
@el.html(response.html)
JavascriptLoader.executeModuleScripts @el, () =>
@setupInputTypes()
@bind()
@queueing()
@executeProblemScripts () =>
@setupInputTypes()
@bind()
......
class @JavascriptLoader
###
Set of library functions that provide common interface for javascript loading
for all module types. All functionality provided by JavascriptLoader should take
place at module scope, i.e. don't run jQuery over entire page
###
# Set of library functions that provide common interface for javascript loading
# for all module types. All functionality provided by JavascriptLoader should take
# place at module scope, i.e. don't run jQuery over entire page
# executeModuleScripts:
# Scan module contents for "script_placeholder"s, then:
# 1) Fetch each script from server
# 2) Explicitly attach the script to the <head> of document
# 3) Explicitly wait for each script to be loaded
# 4) Return to callback function when all scripts loaded
@executeModuleScripts: (el, callback=null) ->
console.log('executeModuleScripts')
# setCollapsibles:
# Scan module contents for generic collapsible containers
@setCollapsibles: (el) =>
###
el: jQuery object representing xmodule
......
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