canonical / sphinx-docs-starter-pack

A documentation starter-pack
https://canonical-starter-pack.readthedocs-hosted.com/
Other
15 stars 40 forks source link

prevent overwriting existing window.onload functions #107

Closed ru-fu closed 1 year ago

ru-fu commented 1 year ago

If another JavaScript already defines a window.onload function, including the github_issue_links.js script will overwrite that function. To prevent this, save the function that is already defined (if there is none, it'll just be empty, so no problem) and add it back as part of the function we're defining.