diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py
index 4211434619..fc71d2da02 100644
--- a/common/lib/xmodule/xmodule/capa_module.py
+++ b/common/lib/xmodule/xmodule/capa_module.py
@@ -75,9 +75,12 @@ class CapaModule(XModule):
'''
icon_class = 'problem'
- js = {'coffee': [resource_string(__name__, 'js/src/capa/display.coffee')],
+ js = {'coffee': [resource_string(__name__, 'js/src/capa/display.coffee'),
+ resource_string(__name__, 'js/src/javascript_loader.coffee'),
+ ],
'js': [resource_string(__name__, 'js/src/capa/imageinput.js'),
resource_string(__name__, 'js/src/capa/schematic.js')]}
+
js_module_name = "Problem"
css = {'scss': [resource_string(__name__, 'css/capa/display.scss')]}
diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py
index c41bbbd413..d51c8ad4a7 100644
--- a/common/lib/xmodule/xmodule/html_module.py
+++ b/common/lib/xmodule/xmodule/html_module.py
@@ -17,7 +17,7 @@ log = logging.getLogger("mitx.courseware")
class HtmlModule(XModule):
- js = {'coffee': [resource_string(__name__, 'js/src/jsloader.coffee'),
+ js = {'coffee': [resource_string(__name__, 'js/src/javascript_loader.coffee'),
resource_string(__name__, 'js/src/html/display.coffee')
]
}
diff --git a/common/lib/xmodule/xmodule/js/src/capa/display.coffee b/common/lib/xmodule/xmodule/js/src/capa/display.coffee
index 8c726f02e7..123f68145a 100644
--- a/common/lib/xmodule/xmodule/js/src/capa/display.coffee
+++ b/common/lib/xmodule/xmodule/js/src/capa/display.coffee
@@ -27,7 +27,7 @@ class @Problem
@$('section.action input.save').click @save
# Collapsibles
- JavascriptLoader.setCollapsibles(@el)
+ Collapsible.setCollapsibles(@el)
# Dynamath
@$('input.math').keyup(@refreshMath)
diff --git a/common/lib/xmodule/xmodule/js/src/html/display.coffee b/common/lib/xmodule/xmodule/js/src/html/display.coffee
index a3e55f8f6c..d39bacc8d0 100644
--- a/common/lib/xmodule/xmodule/js/src/html/display.coffee
+++ b/common/lib/xmodule/xmodule/js/src/html/display.coffee
@@ -3,7 +3,7 @@ class @HTMLModule
constructor: (@element) ->
@el = $(@element)
JavascriptLoader.executeModuleScripts(@el)
- JavascriptLoader.setCollapsibles(@el)
+ Collapsible.setCollapsibles(@el)
$: (selector) ->
$(selector, @el)
diff --git a/common/lib/xmodule/xmodule/js/src/jsloader.coffee b/common/lib/xmodule/xmodule/js/src/javascript_loader.coffee
similarity index 72%
rename from common/lib/xmodule/xmodule/js/src/jsloader.coffee
rename to common/lib/xmodule/xmodule/js/src/javascript_loader.coffee
index 8cc524520a..543aec8edc 100644
--- a/common/lib/xmodule/xmodule/js/src/jsloader.coffee
+++ b/common/lib/xmodule/xmodule/js/src/javascript_loader.coffee
@@ -58,27 +58,3 @@ class @JavascriptLoader
# properly.
$('head')[0].appendChild(s)
$(placeholder).remove()
-
-
- # setCollapsibles:
- # Scan module contents for generic collapsible containers
- @setCollapsibles: (el) =>
- ###
- el: jQuery object representing xmodule
- ###
- el.find('.longform').hide();
- el.find('.shortform').append('See full output');
- el.find('.collapsible section').hide();
- el.find('.full').click @toggleFull
- el.find('.collapsible header a').click @toggleHint
-
- @toggleFull: (event) =>
- $(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')
diff --git a/lms/static/coffee/src/collapsible.coffee b/lms/static/coffee/src/collapsible.coffee
new file mode 100644
index 0000000000..6e469d3704
--- /dev/null
+++ b/lms/static/coffee/src/collapsible.coffee
@@ -0,0 +1,27 @@
+class @Collapsible
+
+ # Set of library functions that provide a simple way to add collapsible
+ # functionality to elements.
+
+ # setCollapsibles:
+ # Scan element's content for generic collapsible containers
+ @setCollapsibles: (el) =>
+ ###
+ el: container
+ ###
+ el.find('.longform').hide()
+ el.find('.shortform').append('See full output')
+ el.find('.collapsible section').hide()
+ el.find('.full').click @toggleFull
+ el.find('.collapsible header a').click @toggleHint
+
+ @toggleFull: (event) =>
+ $(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')