Skip to content

Commit

Permalink
JI-3114 Fix double invocation of registerDomElements
Browse files Browse the repository at this point in the history
  • Loading branch information
fnoks committed Mar 16, 2022
1 parent fb4177e commit e9bf686
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions js/blanks.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,6 @@ H5P.Blanks = (function ($, Question) {
this.labelId = 'h5p-blanks-instructions-' + Blanks.idCounter;
this.content = self.createQuestions();

// Init blanks state
this.registerDomElements();
}

// Inheritance
Blanks.prototype = Object.create(Question.prototype);
Blanks.prototype.constructor = Blanks;

/**
* Registers this question type's DOM elements before they are attached.
* Called from H5P.Question.
*/
Blanks.prototype.registerDomElements = function () {
var self = this;

// Check for task media
var media = self.params.media;
if (media && media.type && media.type.library) {
Expand Down Expand Up @@ -180,7 +165,11 @@ H5P.Blanks = (function ($, Question) {

// Restore previous state
self.setH5PUserState();
};
}

// Inheritance
Blanks.prototype = Object.create(Question.prototype);
Blanks.prototype.constructor = Blanks;

/**
* Create all the buttons for the task
Expand Down

0 comments on commit e9bf686

Please sign in to comment.