Merge pull request #1323 from Pepper-Wood/bug/1294_nonfunctioning_callback_in_docs

Docs workaround for failing callback() section
This commit is contained in:
Knut Sveidqvist 2020-03-30 19:09:14 +02:00 committed by GitHub
commit d0492ec7bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -425,10 +425,10 @@ Examples of tooltip usage below:
```
<script>
var callback = function(){
alert('A callback was triggered');
}
<script>
var callback = function(){
alert('A callback was triggered');
}
</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.
?> 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:
```
<body>
<div class="mermaid">
graph LR;
A-->B;
click A callback "Tooltip"
click B "http://www.github.com" "This is a link"
A-->B;
click A callback "Tooltip"
click B "http://www.github.com" "This is a link"
</div>
<script>
var callback = function(){
var callback = function(){
alert('A callback was triggered');
}
var config = {
startOnLoad:true,
flowchart:{
useMaxWidth:true,
htmlLabels:true,
curve:'cardinal',
},
securityLevel:'loose',
startOnLoad:true,
flowchart:{
useMaxWidth:true,
htmlLabels:true,
curve:'cardinal',
},
securityLevel:'loose',
};
mermaid.initialize(config);