-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix error "initializeDataTables is not a function" when a notebook is reloaded #160
Conversation
I suspect the problem is that You can see an example with the following file: <!DOCTYPE html>
<html>
<body>
<script>
console.log("Hello from regular script 1");
</script>
<script type="module">
console.log("Hello from module");
</script>
<script>
console.log("Hello from regular script 2");
</script>
</body>
</html> The output here (in Chrome at least) is:
However as far as I understand, a deferred script is still guaranteed to run before I've attempted to fix this in catch_retry...fwouts:itables:catch_retry by using a promise. I haven't tested this code though, as I'm not sure how to do that :) There could be a bug or two in there. Is there a contributing guide somewhere? |
Yes - I am not sure how this happens but it does really happen (Jupyter Lab in Chrome under Windows). I have given a quick try at the
You mean a guide on how to setup a dev environment and do some tests? Not at the moment but that is certainly a great idea. I'll take a note of the tests I will be doing, this way we can draft an initial guide... |
Codecov Report
@@ Coverage Diff @@
## main #160 +/- ##
==========================================
+ Coverage 96.44% 96.49% +0.04%
==========================================
Files 23 23
Lines 732 742 +10
==========================================
+ Hits 706 716 +10
Misses 26 26
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Perfect, the contributing guide is typically named CONTRIBUTING.md. Looking forward to it! |
Thanks! I have a draft at |
It looks good! I hadn't seen |
Sometimes when a notebook is reloaded from disk, the tables don't load, and in the console I find a message window.initializeDataTables is not a function.
This PR intends to postpone the table initialization when this occur, to let some time for the init script to load (that script is located in another section of the HTML document).
@fwouts , do you see a better approach? Ideally I would declare a dependency of (the rendered version of)
datatables_template.html
on (the rendered version of)initialize_offline_datatable.html
but I have not idea how to do that...