Skip to content

Commit 84e7c89

Browse files
author
Matthias Koeppe
committed
Activate Thebe when "Sage (live)" tab is clicked
1 parent d8b0a12 commit 84e7c89

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/doc/common/static/jupyter-sphinx-furo.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,16 @@ thebelab.on("status", function (evt, data) {
112112
kernel.requestExecute({code: "%display latex"});
113113
}
114114
});
115+
116+
// Activate Thebe when "Sage (live)" tab is clicked
117+
document.querySelectorAll('input[class="tab-input"]').forEach((elem) => {
118+
elem.addEventListener("click", function(event) {
119+
if (elem.nextElementSibling) {
120+
if (elem.nextElementSibling.nextElementSibling) {
121+
if (elem.nextElementSibling.nextElementSibling.querySelector('div[class="thebelab-code"]')) {
122+
initThebelab();
123+
}
124+
}
125+
}
126+
});
127+
});

0 commit comments

Comments
 (0)