[Pkg-javascript-commits] [d3-tip.js] 17/17: Fixes #152
Sunil Mohan Adapa
sunilmohan-guest at moszumanska.debian.org
Thu Dec 8 10:37:12 UTC 2016
This is an automated email from the git hooks/post-receive script.
sunilmohan-guest pushed a commit to branch upstream
in repository d3-tip.js.
commit 3aa7df4620e3745fee62e8414e898d22d1ee48b3
Author: Tim van der Horst <tim.vanderhorst at sportsmedglobal.com>
Date: Mon Oct 10 11:51:49 2016 +1000
Fixes #152
---
docs/positioning-tooltips.md | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/docs/positioning-tooltips.md b/docs/positioning-tooltips.md
index 01cab02..d131b46 100644
--- a/docs/positioning-tooltips.md
+++ b/docs/positioning-tooltips.md
@@ -13,11 +13,14 @@ tip.direction('s') // Position the tooltip to the bottom of a target element
tip.direction('e') // Position the tooltip to the right of a target element
tip.direction('w') // Position the tooltip to the left of a target element
```
-##### Changing the direction programatically
+
+Callbacks are supported for changing the direction programatically,
+with the tooltip passed as `this`.
+
``` javascript
tip.direction(function(d) {
- if(d == 'california') return 'w'
- if(d == 'new york') return 'e'
+ if (d === 'california') return 'w'
+ if (d === 'new york') return 'e'
})
```
@@ -32,8 +35,9 @@ enough in the desired direction so the extender doesn't overlap the target eleme
tip.offset([10, -10])
```
-Callbacks are also supported for dynamic positioning. The following example
-will center tip placement within the bounding box of the target element.
+Callbacks are also supported for dynamic positioning, with the tooltip passed
+as `this`. The following example will center tip placement within the bounding
+box of the target element.
``` javascript
tip.offset(function() {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/d3-tip.js.git
More information about the Pkg-javascript-commits
mailing list