Skip to content
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

When changin pages in navigation, diagram is not loading again #10

Open
mmalyska opened this issue Jul 12, 2023 · 4 comments
Open

When changin pages in navigation, diagram is not loading again #10

mmalyska opened this issue Jul 12, 2023 · 4 comments

Comments

@mmalyska
Copy link

I have issue with this plugin. When I change page via navigation menu the diagram is not loaded. When entering page for the first time(or refreshing) the diagram is loading.
My mkdocs are using material theme.
Page with problem Page and Source

@mmalyska mmalyska changed the title When changin pages in navigation diagram is not loading again When changin pages in navigation, diagram is not loading again Jul 12, 2023
@joakibo
Copy link

joakibo commented Oct 12, 2023

Confirming this issue. Navigating to page and it doesn't load draw.io diagrams, no errors in the network logs in Chrome, it just stops. Refreshing, or going to page link directly and it works. We are also using mkdocs-material.

@joakibo
Copy link

joakibo commented Oct 13, 2023

We have narrowed down the issue, the problem is due to Javascript not loading on mkdocs-material's navigation.instant feature. See related issue here: squidfunk/mkdocs-material#5816

Disabling navigation.instant in mkdocs.yml and things will start to work.

The proposed worked around mentioned in the above issue is to wrap JavaScript in the following:

document$.subscribe(function() {
  console.log("Put your code here") // Executes on `DOMContentLoaded` and on instant navigation
})

Possibly something which could be incorporated somehow here.

@tuunit
Copy link
Contributor

tuunit commented Jan 5, 2025

I was in touch with Sergey the original author and he will not maintain this repo / package anymore. It has been replaced by my fork a while ago https://github.com/tuunit/mkdocs-drawio

Please read the Readme on how to support instant loading and the material design. We have a working setup for instant loading inside the examples directory as well.

@joakibo
Copy link

joakibo commented Jan 6, 2025

Thanks @tuunit, we'll look at https://github.com/tuunit/mkdocs-drawio then and most likely move over to that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants