Skip to content

Commit

Permalink
Pass btn and jtippy instance to title function
Browse files Browse the repository at this point in the history
  • Loading branch information
HTMLGuyLLC committed Oct 15, 2019
1 parent c4eb08f commit f5dbd05
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Defaults are shown
```javascript
$(function(){
$('[data-toggle="tooltip"]').jTippy({
//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
//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
title: '',
//string ('click', 'hover', 'focus', 'hoverfocus'): defines when the tooltip should be shown
trigger: 'hoverfocus',
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ <h4>All options and events with defaults:</h4>
<pre style="display:inline-block;width:800px;max-width:100%; text-align:left;"><code class="javascript">
$(function(){
$('[data-toggle="tooltip"]').jTippy({
//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
//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
title: '',
//string ('click', 'hover', 'focus', 'hoverfocus'): defines when the tooltip should be shown
trigger: 'hoverfocus',
Expand Down
2 changes: 1 addition & 1 deletion jTippy.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
}
//get string from function
if( typeof trigger_event === 'undefined' || trigger_event ){
if( typeof helper.title === 'function' ) helper.content = helper.title();
if( typeof helper.title === 'function' ) helper.content = helper.title(helper.dom_wrapped, helper);
}
//add the tooltip to the dom
body.append(helper.createTooltipHTML());
Expand Down
2 changes: 1 addition & 1 deletion jTippy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jtippy",
"version": "1.7.1",
"version": "1.7.2",
"description": "jQuery tooltip plugin",
"author": {
"name" : "HTMLGuy, LLC",
Expand Down

0 comments on commit f5dbd05

Please sign in to comment.