Docs workaround for failing callback() section

This commit is contained in:
Kathryn DiPippo 2020-03-29 00:55:14 -04:00
parent 6ddd394e33
commit e0d97d44aa

View File

@ -425,10 +425,10 @@ Examples of tooltip usage below:
``` ```
<script> <script>
var callback = function(){ var callback = function(){
alert('A callback was triggered'); alert('A callback was triggered');
} }
<script> </script>
``` ```
``` ```
@ -448,28 +448,30 @@ graph LR;
``` ```
> **Success** The tooltip functionality and the ability to link to urls are available from version 0.5.2. > **Success** The tooltip functionality and the ability to link to urls are available from version 0.5.2.
?> Due to limitations with how Docsify handles JavaScript callback functions, an alternate working demo for the above code can be viewed at [this jsfiddle](https://jsfiddle.net/s37cjoau/3/).
Beginners tip, a full example using interactive links in a html context: Beginners tip, a full example using interactive links in a html context:
``` ```
<body> <body>
<div class="mermaid"> <div class="mermaid">
graph LR; graph LR;
A-->B; A-->B;
click A callback "Tooltip" click A callback "Tooltip"
click B "http://www.github.com" "This is a link" click B "http://www.github.com" "This is a link"
</div> </div>
<script> <script>
var callback = function(){ var callback = function(){
alert('A callback was triggered'); alert('A callback was triggered');
} }
var config = { var config = {
startOnLoad:true, startOnLoad:true,
flowchart:{ flowchart:{
useMaxWidth:true, useMaxWidth:true,
htmlLabels:true, htmlLabels:true,
curve:'cardinal', curve:'cardinal',
}, },
securityLevel:'loose', securityLevel:'loose',
}; };
mermaid.initialize(config); mermaid.initialize(config);