Skip to content

Commit

Permalink
add api doc for on/off methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sporritt committed Sep 2, 2015
1 parent b7a0432 commit 017b8a9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

- Small update to getOffset to make it return the correct value if the input element was the container itself.
- Small update to animation to fix incorrect falsey check.
- Documented the `on` method of a `jsPlumbInstance` in the API docs.
- `on` and `off` event registration methods now return the current jsPlumb instance

* 1.7.9

Expand Down
25 changes: 25 additions & 0 deletions doc/api/jsplumb-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1026,3 +1026,28 @@
* @default "_jsPlumb_Default_Scope"
*/

/**
* Register an event handler, optionally as a delegate for some set of descendant elements. Note
* that this method takes either 3 or 4 arguments - if you supply 3 arguments it is assumed you have
* omitted the `children` parameter, and that the event handler should be bound directly to the given element.
* @method on
* @param {Element[]|Element|String} el Either an Element, or a CSS selector (if you want to specify an ID you must prepend it with '#'), or an array of Elements.
* @param {String} [children] Comma-delimited list of selectors identifying allowed children.
* @param {String} event Event ID.
* @param {Function} fn Event handler function.
* @chainable
* @return {jsPlumbInstance} The current jsPlumb instance; you can chain this method.
*/

/**
* Cancel delegate event handling for the given function. Note that unlike with 'on' you do not supply
* a list of child selectors here: it removes event delegation from all of the child selectors for which the
* given function was registered (if any).
* @method off
* @param {Element[]|Element|String} el Either an Element, or a CSS selector (if you want to specify an ID you must prepend it with '#'), or an array of Elements, from which to remove the event listener.
* @param {String} event Event ID.
* @param {Function} fn Event handler function.
* @chainable
* @return {jsPlumbInstance} The current jsPlumb instance; you can chain this method.
*/

2 changes: 2 additions & 0 deletions doc/wiki/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- Small update to getOffset to make it return the correct value if the input element was the container itself.
- Small update to animation to fix incorrect falsey check.
- Documented the `on` method of a `jsPlumbInstance` in the API docs.
- `on` and `off` event registration methods now return the current jsPlumb instance


## 1.7.9
Expand Down

0 comments on commit 017b8a9

Please sign in to comment.