Skip to content
Snippets Groups Projects
Commit 5a5b73dc authored by Calen Pennington's avatar Calen Pennington
Browse files

Load xblock resources into studio *before* the corresponding xblock html

parent 8b357566
No related branches found
No related tags found
No related merge requests found
......@@ -125,7 +125,8 @@ define(['jquery', 'underscore', 'common/js/components/utils/view_utils', 'js/vie
*/
renderXBlockFragment: function(fragment, element) {
var html = fragment.html,
resources = fragment.resources;
resources = fragment.resources,
blockView = this;
if (!element) {
element = this.$el;
}
......@@ -135,8 +136,9 @@ define(['jquery', 'underscore', 'common/js/components/utils/view_utils', 'js/vie
// by included scripts are logged to the console but are then ignored assuming
// that at least the rendered HTML will be in place.
try {
this.updateHtml(element, html);
return this.addXBlockFragmentResources(resources);
return this.addXBlockFragmentResources(resources).done(function() {
blockView.updateHtml(element, html);
});
} catch (e) {
console.error(e, e.stack);
return $.Deferred().resolve();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment