From 5ca629ec90c03f0d8204c8928aabb15c8e981140 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Sun, 6 Dec 2020 14:14:04 +0100 Subject: [PATCH] parenthesis are mandatory --- docs/diagrams-and-syntax-and-examples/flowchart.md | 8 ++++---- src/diagrams/flowchart/parser/flow-interactions.spec.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/diagrams-and-syntax-and-examples/flowchart.md b/docs/diagrams-and-syntax-and-examples/flowchart.md index acb77de77..a5e53b330 100644 --- a/docs/diagrams-and-syntax-and-examples/flowchart.md +++ b/docs/diagrams-and-syntax-and-examples/flowchart.md @@ -601,7 +601,7 @@ flowchart TB It is possible to bind a click event to a node, the click can lead to either a javascript callback or to a link which will be opened in a new browser tab. **Note**: This functionality is disabled when using `securityLevel='strict'` and enabled when using `securityLevel='loose'`. ``` -click nodeId call callback +click nodeId call callback() ``` * nodeId is the id of the node @@ -620,7 +620,7 @@ Examples of tooltip usage below: ``` graph LR; A-->B; - click A call callback "Tooltip for a callback" + click A call callback() "Tooltip for a callback" click B href "http://www.github.com" "This is a tooltip for a link" ``` @@ -629,7 +629,7 @@ The tooltip text is surrounded in double quotes. The styles of the tooltip are s ```mermaid graph LR A-->B; - click A call callback "Tooltip" + click A call callback() "Tooltip" click B href "http://www.github.com" "This is a link" ``` > **Success** The tooltip functionality and the ability to link to urls are available from version 0.5.2. @@ -659,7 +659,7 @@ Beginners tip, a full example using interactive links in a html context:
graph LR; A-->B; - click A call callback "Tooltip" + click A call callback() "Tooltip" click B href "http://www.github.com" "This is a link"
diff --git a/src/diagrams/flowchart/parser/flow-interactions.spec.js b/src/diagrams/flowchart/parser/flow-interactions.spec.js index 593cd193e..18c54db0b 100644 --- a/src/diagrams/flowchart/parser/flow-interactions.spec.js +++ b/src/diagrams/flowchart/parser/flow-interactions.spec.js @@ -25,7 +25,7 @@ describe('[Interactions] when parsing', () => { it('it should be possible to use click to a callback with toolip', function() { spyOn(flowDb, 'setClickEvent'); spyOn(flowDb, 'setTooltip'); - const res = flow.parser.parse('graph TD\nA-->B\nclick A call callback "tooltip"'); + const res = flow.parser.parse('graph TD\nA-->B\nclick A call callback() "tooltip"'); const vert = flow.parser.yy.getVertices(); const edges = flow.parser.yy.getEdges();