Skip to content

Commit

Permalink
Fix: New JS API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pylover committed Aug 20, 2021
1 parent 42ce422 commit a55156d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion adia/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .renderer import Renderer


__version__ = '4.0.0'
__version__ = '4.0.1'
__all__ = [
'Diagram',
'SequenceDiagram',
Expand Down
17 changes: 8 additions & 9 deletions documentation/javascriptapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ as the below:
/* ADia configuration */
window.aDia.delay = 10
window.aDia.addHook('init', (aDia) => {
window.aDia.oninit = (aDia) => {
versionArea.innerText = `ADia version: ${aDia.__version__}`
});
};
window.aDia.input = () => sourceArea.value
window.aDia.addHook('result', () => {
window.aDia.input = () => sourceArea.value
window.aDia.onresult = () => {
errorArea.value = '';
targetArea.value = '';
});
};
window.aDia.addHook('success', (aDia, dia) => targetArea.value = dia)
window.aDia.addHook('error', (aDia, err) => errorArea.value = msg)
window.aDia.addHook('status', (aDia, state) => statusArea.innerText = state)
window.aDia.onsuccess = (aDia, dia) => targetArea.value = dia
window.aDia.onerror = (aDia, err) => errorArea.value = msg
window.aDia.onstatus = (aDia, state) => statusArea.innerText = state
const go = aDia.go.bind(aDia);
Expand All @@ -157,7 +157,6 @@ as the below:
</body>
</html>


The ``ADia`` class will listen for changes of source element and inform you
by provided callbacks.

Expand Down

0 comments on commit a55156d

Please sign in to comment.