Pass DOM element, not jQuery object to XBlock initialisation.

The function initializeXBlock() expects a DOM element, and is passed one in most
cases.  However, when adding a new XBlock component in Studio, the function is
passed a jQuery object, which ends up being forwarded to the actual
initialisation function of the XBlock.
This commit is contained in:
Sven Marnach
2016-02-04 23:31:38 +01:00
parent 9fd6bef39f
commit 982c3e623b
6 changed files with 14 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ define(["jquery", "underscore", "common/js/components/utils/view_utils", "js/vie
fragmentsRendered.always(function() {
xblockElement = self.$('.xblock').first();
try {
xblock = XBlock.initializeBlock(xblockElement);
xblock = XBlock.initializeBlock(xblockElement.get(0));
self.xblock = xblock;
self.xblockReady(xblock);
if (successCallback) {