diff --git a/common/lib/xmodule/xmodule/x_module.py b/common/lib/xmodule/xmodule/x_module.py index e6d367ac7a..ab3fe8c027 100644 --- a/common/lib/xmodule/xmodule/x_module.py +++ b/common/lib/xmodule/xmodule/x_module.py @@ -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 # 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 - js = cls.js + coffee = cls.js.setdefault('coffee', []) + fragment = resource_string(__name__, 'js/src/xmodule.coffee') - if js is None: - js = {} + if fragment not in coffee: + coffee.insert(0, fragment) - if 'coffee' not in js: - js['coffee'] = [] - - js['coffee'].append(resource_string(__name__, 'js/src/xmodule.coffee')) - - return js + return cls.js @classmethod def get_css(cls):