Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 44fbba2

Browse files
committed
Fix: Enable datafile directive to indicate when it's ready.
1 parent eae9a06 commit 44fbba2

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

runestone/datafile/js/datafile.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,27 @@ class DataFile extends RunestoneBase {
4040
this.createPre();
4141
}
4242
}
43+
this.indicate_component_ready();
4344
}
4445
/*=====================================
4546
== Create either <pre> or <textarea> ==
4647
== depending on if editing is true ==
4748
==================================*/
4849
createPre() {
49-
this.preContainer = document.createElement("pre");
50-
this.preContainer.id = this.divid;
51-
$(this.preContainer).attr({ style: "display: " + this.displayClass });
52-
this.preContainer.innerHTML = this.origElem.innerHTML;
53-
$(this.origElem).replaceWith(this.preContainer);
50+
this.containerDiv = document.createElement("pre");
51+
this.containerDiv.id = this.divid;
52+
$(this.containerDiv).attr({ style: "display: " + this.displayClass });
53+
this.containerDiv.innerHTML = this.origElem.innerHTML;
54+
$(this.origElem).replaceWith(this.containerDiv);
5455
}
5556
createTextArea() {
56-
this.textAreaContainer = document.createElement("textarea");
57-
this.textAreaContainer.id = this.divid;
58-
this.textAreaContainer.rows = this.numberOfRows;
59-
this.textAreaContainer.cols = this.numberOfCols;
60-
this.textAreaContainer.innerHTML = this.origElem.innerHTML;
61-
$(this.textAreaContainer).addClass("datafiletextfield");
62-
$(this.origElem).replaceWith(this.textAreaContainer);
57+
this.containerDiv = document.createElement("textarea");
58+
this.containerDiv.id = this.divid;
59+
this.containerDiv.rows = this.numberOfRows;
60+
this.containerDiv.cols = this.numberOfCols;
61+
this.containerDiv.innerHTML = this.origElem.innerHTML;
62+
$(this.containerDiv).addClass("datafiletextfield");
63+
$(this.origElem).replaceWith(this.containerDiv);
6364
}
6465
}
6566

0 commit comments

Comments
 (0)