Implement RequireJS Optimizer in the LMS
TNL-2487
This commit is contained in:
@@ -2,12 +2,12 @@ define(["jquery", "backbone", "teams/js/teams_tab_factory"],
|
||||
function($, Backbone, TeamsTabFactory) {
|
||||
'use strict';
|
||||
|
||||
describe("teams django app", function() {
|
||||
describe("Teams tab", function() {
|
||||
var teamsTab;
|
||||
|
||||
beforeEach(function() {
|
||||
setFixtures('<section class="teams-content"></section>');
|
||||
teamsTab = new TeamsTabFactory({results: []}, '', 'edX/DemoX/Demo_Course');
|
||||
teamsTab = new TeamsTabFactory($(".teams-content"), {results: []}, '', 'edX/DemoX/Demo_Course');
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
define(['jquery', 'teams/js/views/teams_tab', 'teams/js/collections/topic'],
|
||||
function ($, TeamsTabView, TopicCollection) {
|
||||
return function (topics, topics_url, course_id) {
|
||||
return function (element, topics, topics_url, course_id) {
|
||||
var topicCollection = new TopicCollection(topics, {url: topics_url, course_id: course_id, parse: true});
|
||||
topicCollection.bootstrap();
|
||||
var view = new TeamsTabView({
|
||||
el: $('.teams-content'),
|
||||
el: element,
|
||||
topicCollection: topicCollection
|
||||
});
|
||||
view.render();
|
||||
|
||||
@@ -21,11 +21,7 @@
|
||||
</div>
|
||||
|
||||
<%block name="js_extra">
|
||||
<script type="text/javascript">
|
||||
(function (require) {
|
||||
require(['teams/js/teams_tab_factory'], function (TeamsTabFactory) {
|
||||
new TeamsTabFactory(${ json.dumps(topics, cls=EscapedEdxJSONEncoder) }, '${ topics_url }', '${ unicode(course.id) }');
|
||||
});
|
||||
}).call(this, require || RequireJS.require);
|
||||
</script>
|
||||
<%static:require_module module_name="teams/js/teams_tab_factory" class_name="TeamsTabFactory">
|
||||
TeamsTabFactory($('.teams-content'), ${ json.dumps(topics, cls=EscapedEdxJSONEncoder) }, '${ topics_url }', '${ unicode(course.id) }');
|
||||
</%static:require_module>
|
||||
</%block>
|
||||
|
||||
Reference in New Issue
Block a user