Only add the xmodule.coffee file once per class, and put it before all other coffeescript files
This commit is contained in:
@@ -45,17 +45,13 @@ class HTMLSnippet(object):
|
|||||||
# cdodge: We've moved the xmodule.coffee script from an outside directory into the xmodule area of common
|
# cdodge: We've moved the xmodule.coffee script from an outside directory into the xmodule area of common
|
||||||
# this means we need to make sure that all xmodules include this dependency which had been previously implicitly
|
# this means we need to make sure that all xmodules include this dependency which had been previously implicitly
|
||||||
# fulfilled in a different area of code
|
# fulfilled in a different area of code
|
||||||
js = cls.js
|
coffee = cls.js.setdefault('coffee', [])
|
||||||
|
fragment = resource_string(__name__, 'js/src/xmodule.coffee')
|
||||||
|
|
||||||
if js is None:
|
if fragment not in coffee:
|
||||||
js = {}
|
coffee.insert(0, fragment)
|
||||||
|
|
||||||
if 'coffee' not in js:
|
return cls.js
|
||||||
js['coffee'] = []
|
|
||||||
|
|
||||||
js['coffee'].append(resource_string(__name__, 'js/src/xmodule.coffee'))
|
|
||||||
|
|
||||||
return js
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_css(cls):
|
def get_css(cls):
|
||||||
|
|||||||
Reference in New Issue
Block a user