Skip to content

Commit f5dbd05

Browse files
committed
Pass btn and jtippy instance to title function
1 parent c4eb08f commit f5dbd05

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Defaults are shown
6767
```javascript
6868
$(function(){
6969
$('[data-toggle="tooltip"]').jTippy({
70-
//string/function returning string: overridden by the title attribute - function is run every time the tooltip is displayed and can be used to grab content via XHR/AJAX
70+
//string/function(btn, jtippy):string returning string: overridden by the title attribute - function is run every time the tooltip is displayed and can be used to grab content via XHR/AJAX
7171
title: '',
7272
//string ('click', 'hover', 'focus', 'hoverfocus'): defines when the tooltip should be shown
7373
trigger: 'hoverfocus',

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ <h4>All options and events with defaults:</h4>
180180
<pre style="display:inline-block;width:800px;max-width:100%; text-align:left;"><code class="javascript">
181181
$(function(){
182182
$('[data-toggle="tooltip"]').jTippy({
183-
//string/function returning string: overridden by the title attribute - function is run every time the tooltip is displayed and can be used to grab content via XHR/AJAX
183+
//string/function(btn, jtippy):string - overridden by the title attribute - function is run every time the tooltip is displayed and can be used to grab content via XHR/AJAX
184184
title: '',
185185
//string ('click', 'hover', 'focus', 'hoverfocus'): defines when the tooltip should be shown
186186
trigger: 'hoverfocus',

jTippy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
}
217217
//get string from function
218218
if( typeof trigger_event === 'undefined' || trigger_event ){
219-
if( typeof helper.title === 'function' ) helper.content = helper.title();
219+
if( typeof helper.title === 'function' ) helper.content = helper.title(helper.dom_wrapped, helper);
220220
}
221221
//add the tooltip to the dom
222222
body.append(helper.createTooltipHTML());

jTippy.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jtippy",
3-
"version": "1.7.1",
3+
"version": "1.7.2",
44
"description": "jQuery tooltip plugin",
55
"author": {
66
"name" : "HTMLGuy, LLC",

0 commit comments

Comments
 (0)