From 3acf394d052f9ac6fe151cb9b64703735f79ed72 Mon Sep 17 00:00:00 2001 From: cahrens Date: Mon, 16 Jun 2014 16:31:46 -0400 Subject: [PATCH] Wait for scripts defined in common xmodule code to execute. STUD-1792 --- cms/templates/container.html | 19 ++++++------ cms/templates/edit-tabs.html | 20 +++++++------ cms/templates/unit.html | 30 ++++++++++--------- .../pipeline_js/templates/xmodule.js | 13 ++++++-- 4 files changed, 47 insertions(+), 35 deletions(-) diff --git a/cms/templates/container.html b/cms/templates/container.html index 0062d91628..4ae77e6601 100644 --- a/cms/templates/container.html +++ b/cms/templates/container.html @@ -32,19 +32,18 @@ main_xblock_info = { diff --git a/cms/templates/edit-tabs.html b/cms/templates/edit-tabs.html index 1c5adf846c..bc1a4294ae 100644 --- a/cms/templates/edit-tabs.html +++ b/cms/templates/edit-tabs.html @@ -21,16 +21,18 @@ diff --git a/cms/templates/unit.html b/cms/templates/unit.html index 4ed9e5ba2a..f28075a1ca 100644 --- a/cms/templates/unit.html +++ b/cms/templates/unit.html @@ -21,25 +21,27 @@ from django.utils.translation import ugettext as _ <%block name="jsextra"> diff --git a/common/djangoapps/pipeline_js/templates/xmodule.js b/common/djangoapps/pipeline_js/templates/xmodule.js index 4dedffd04a..4004342145 100644 --- a/common/djangoapps/pipeline_js/templates/xmodule.js +++ b/common/djangoapps/pipeline_js/templates/xmodule.js @@ -21,8 +21,17 @@ define(["jquery", "underscore", "mathjax", "codemirror", "tinymce", var urls = ${urls}; var head = $("head"); - $.each(urls, function(i, url) { + var deferred = $.Deferred(); + var numResources = urls.length; + $.each(urls, function (i, url) { head.append($("