Skip to content

Commit 2040ab1

Browse files
Document events (#331)
Closes #228
1 parent fac3c3c commit 2040ab1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/intro.md

+18
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,24 @@ The `Tether` object has these methods:
458458
- `destroy()` - Disable and remove all references
459459
- `position()` - Manually trigger a repositioning
460460

461+
Events
462+
------
463+
464+
The `Tether` object also has events support, since it extends our `Evented` class.
465+
466+
The methods exposed to listen to events are:
467+
468+
- `on(event, handler)` - Adds an event listener that is fired whenever the event is fired
469+
- `once(event, handler)` - Adds an event listener that is only fired the first time the event is fired
470+
- `off(event, handler)` - Removes the event listener
471+
- `trigger(event)` - Manually triggers events
472+
473+
The events fired are:
474+
475+
- `repositioned` - Fired whenever the tether element is moved
476+
- `update` - Fired whenever the Tether instance runs into a constraint. You could use this
477+
for things like manually flipping an arrow or other tweaks.
478+
461479
Options
462480
-------
463481

0 commit comments

Comments
 (0)