mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
fix: startOnLoad
This commit is contained in:
parent
a51d8e844b
commit
d97b3807b9
@ -144,9 +144,11 @@ const initialize = function (config: MermaidConfig) {
|
|||||||
* configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the page.
|
* configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the page.
|
||||||
*/
|
*/
|
||||||
const contentLoaded = function () {
|
const contentLoaded = function () {
|
||||||
const { startOnLoad } = mermaidAPI.getConfig();
|
if (mermaid.startOnLoad) {
|
||||||
if (startOnLoad) {
|
const { startOnLoad } = mermaidAPI.getConfig();
|
||||||
mermaid.init();
|
if (startOnLoad) {
|
||||||
|
mermaid.init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -183,6 +185,7 @@ const setParseErrorHandler = function (newParseErrorHandler: (err: any, hash: an
|
|||||||
};
|
};
|
||||||
|
|
||||||
const mermaid = {
|
const mermaid = {
|
||||||
|
startOnLoad: true,
|
||||||
diagrams: {},
|
diagrams: {},
|
||||||
mermaidAPI,
|
mermaidAPI,
|
||||||
parse: mermaidAPI != undefined ? mermaidAPI.parse : null,
|
parse: mermaidAPI != undefined ? mermaidAPI.parse : null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user