Skip to content

Commit

Permalink
Revert "Issue #75 - fix issue where new itables would break toc."
Browse files Browse the repository at this point in the history
This reverts commit 694ecbd.
  • Loading branch information
JanPalasek committed Feb 23, 2024
1 parent a2f48c5 commit a267420
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pretty-jupyter"
authors = [{name = "Jan Palasek"}]
description = "Exports Jupyter notebook into beautiful and dynamic HTML report."
license = {file = "LICENSE.md"}
version = "2.0.6"
version = "2.0.5"
readme = "README.md"
dependencies = [
"click",
Expand Down
7 changes: 7 additions & 0 deletions src/pretty_jupyter/templates/pj/index.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@

{# js files for notebooks: extend this to provide custom javascript #}
{% block notebook_js %}
<!-- hotfix to support interactive tables package -->
<script type="text/javascript">
if ($(".output_subarea.output_javascript").length > 0) {
jQuery.noConflict(false);
}
</script>

{{ resources.include_js("static/pj.js") }}

<script type="text/javascript">
Expand Down
14 changes: 2 additions & 12 deletions src/pretty_jupyter/templates/pj/static/pj.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,8 @@ window.initializeTOC = function (tocDepth, tocCollapsed, tocSmoothScroll, tocExt

options.smoothScroll = tocSmoothScroll;

// invoke tocify.. if it fails with an error, solve jquery and run again
for (let i = 0; i < 5; i++) {
try {
// invoke tocify, if successful, break
$("#TOC").tocify(options).data("toc-tocify");
break;
}
catch {
// if tocify fails, try again
jQuery.noConflict(false);
}
}
// tocify
var toc = $("#TOC").tocify(options).data("toc-tocify");

if (!tocCollapsed) {
toc.setOptions({ "showAndHideOnScroll": false, "showAndHide": false });
Expand Down

0 comments on commit a267420

Please sign in to comment.