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

Commit 20cc5dc

Browse files
committed
Fix: 2 login-complete handlers operate in undefined orders
1 parent 7c574da commit 20cc5dc

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

runestone/activecode/js/activecode.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,6 +2699,10 @@ $(document).ready(function() {
26992699
for (k in edList) {
27002700
edList[k].disableSaveLoad();
27012701
}
2702+
} else {
2703+
for (k in edList) {
2704+
edList[k].enableSaveLoad();
2705+
}
27022706
}
27032707

27042708
});
@@ -2708,13 +2712,6 @@ if (typeof component_factory === 'undefined') {
27082712
}
27092713
component_factory['activecode'] = ACFactory.createActiveCodeFromOpts;
27102714

2711-
$(document).bind("runestone:login", function() {
2712-
for (k in edList) {
2713-
if (edList.hasOwnProperty(k)) {
2714-
edList[k].enableSaveLoad();
2715-
}
2716-
}
2717-
});
27182715

27192716
// This seems a bit hacky and possibly brittle, but its hard to know how long it will take to
27202717
// figure out the login/logout status of the user. Sometimes its immediate, and sometimes its

runestone/reveal/js/reveal.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,11 @@ Reveal.prototype.hideInline = function () {
243243
== Find the custom HTML tags and ==
244244
== execute our code on them ==
245245
=================================*/
246-
$(document).ready(function () {
246+
247+
$(document).bind("runestone:login-complete",function () {
247248
$("[data-component=reveal]").each(function (index) {
248249
RevealList[this.id] = new Reveal({"orig": this});
249250
});
250-
});
251-
252-
$(document).bind("runestone:login-complete",function () {
253251
if (eBookConfig.isInstructor) {
254252
for (const divid of Object.keys(RevealList)) {
255253
if (RevealList[divid].instructorOnly) {

0 commit comments

Comments
 (0)