fix: make 'conditional' xblocks work again after being broken
I accidentally broke them in commit b90039b2 by passing in an
extra argument to display.js constructors.
TNL-8318
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable */
|
||||
(function() {
|
||||
this.Conditional = (function() {
|
||||
function Conditional(element, callerElId) {
|
||||
function Conditional(element, runtime, callerElId) {
|
||||
var dependencies;
|
||||
this.el = $(element).find('.conditional-wrapper');
|
||||
this.callerElId = callerElId;
|
||||
|
||||
@@ -63,7 +63,8 @@
|
||||
// Initialize Conditional constructors.
|
||||
if (_this.wrapperSectionEl !== null) {
|
||||
$(_this.wrapperSectionEl).find('.xmodule_ConditionalModule').each(function(index, value) {
|
||||
new window.Conditional(value, _this.id.replace(/^poll_/, ''));
|
||||
// eslint-disable-next-line no-new
|
||||
new window.Conditional(value, _this.runtime, _this.id.replace(/^poll_/, ''));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -103,7 +104,8 @@
|
||||
// notifying the constructor that this is a reset operation.
|
||||
if (_this.wrapperSectionEl !== null) {
|
||||
$(_this.wrapperSectionEl).find('.xmodule_ConditionalModule').each(function(index, value) {
|
||||
new window.Conditional(value, _this.id.replace(/^poll_/, ''));
|
||||
// eslint-disable-next-line no-new
|
||||
new window.Conditional(value, _this.runtime, _this.id.replace(/^poll_/, ''));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -234,9 +236,10 @@
|
||||
|
||||
return PollMain;
|
||||
|
||||
function PollMain(el) {
|
||||
function PollMain(el, runtime) {
|
||||
var _this;
|
||||
|
||||
this.runtime = runtime;
|
||||
this.questionEl = $(el).find('.poll_question');
|
||||
if (this.questionEl.length !== 1) {
|
||||
// We require one question DOM element.
|
||||
|
||||
Reference in New Issue
Block a user