Skip to content

Commit e04dfe6

Browse files
committed
Fixed jt-show second param (tooltip) and added hide method
1 parent a80fde6 commit e04dfe6

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ $(function(){
8585
singleton: true,
8686
//boolean: if true and trigger: 'click', when clicking outside the tooltip, it will be hidden
8787
close_on_outside_click: true,
88-
}).on('jt-show', function(e, tooltip){
88+
}).on('jt-show', function(e, tooltip, hide){
8989
//triggered on show of tooltip
90-
//tooltip dom element is passed as the second parameter
90+
//the tooltip's jquery dom object is provided as the second param
91+
//to hide the tooltip, run hide()
9192
}).on('jt-hide', function(e){
9293
//triggered on hide of tooltip
9394
});

index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,10 @@ <h4>All options and events with defaults:</h4>
198198
singleton: true,
199199
//boolean: if true and trigger: 'click', when clicking outside the tooltip, it will be hidden
200200
close_on_outside_click: true,
201-
}).on('jt-show', function(e, tooltip){
201+
}).on('jt-show', function(e, tooltip, hide){
202202
//triggered on show of tooltip
203-
//tooltip dom element is passed as the second parameter
203+
//the tooltip's jquery dom object is provided as the second param
204+
//to hide the tooltip, run hide()
204205
}).on('jt-hide', function(e){
205206
//triggered on hide of tooltip
206207
});

jTippy.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,7 @@
229229
$.jTippy.visible.push(helper);
230230
//trigger event on show and pass the tooltip
231231
if( typeof trigger_event === 'undefined' || trigger_event ) {
232-
helper.dom.trigger('jt-show', {
233-
'tooltip': helper.tooltip
234-
});
232+
helper.dom.trigger('jt-show', [helper.tooltip, helper.hide]);
235233
}
236234
},
237235
//is this tooltip visible

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: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"name": "jtippy",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"description": "jQuery tooltip plugin",
5+
"author": {
6+
"name" : "HTMLGuy, LLC",
7+
"url" : "https://htmlguy.com"
8+
},
59
"main": "jTippy.min.js",
610
"repository": {
711
"type": "git",
@@ -13,10 +17,7 @@
1317
"homepage": "https://htmlguyllc.github.io/jTippy/",
1418
"private": false,
1519
"dependencies": {
16-
"jquery": "^3.0.0"
20+
"jquery": "^3.4.0"
1721
},
18-
"license": {
19-
"type": "MIT",
20-
"url": "https://www.opensource.org/licenses/mit-license.php"
21-
}
22+
"license": "MIT"
2223
}

0 commit comments

Comments
 (0)