Skip to content

Commit

Permalink
Fixed jt-show second param (tooltip) and added hide method
Browse files Browse the repository at this point in the history
  • Loading branch information
HTMLGuyLLC committed Sep 21, 2019
1 parent a80fde6 commit e04dfe6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ $(function(){
singleton: true,
//boolean: if true and trigger: 'click', when clicking outside the tooltip, it will be hidden
close_on_outside_click: true,
}).on('jt-show', function(e, tooltip){
}).on('jt-show', function(e, tooltip, hide){
//triggered on show of tooltip
//tooltip dom element is passed as the second parameter
//the tooltip's jquery dom object is provided as the second param
//to hide the tooltip, run hide()
}).on('jt-hide', function(e){
//triggered on hide of tooltip
});
Expand Down
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ <h4>All options and events with defaults:</h4>
singleton: true,
//boolean: if true and trigger: 'click', when clicking outside the tooltip, it will be hidden
close_on_outside_click: true,
}).on('jt-show', function(e, tooltip){
}).on('jt-show', function(e, tooltip, hide){
//triggered on show of tooltip
//tooltip dom element is passed as the second parameter
//the tooltip's jquery dom object is provided as the second param
//to hide the tooltip, run hide()
}).on('jt-hide', function(e){
//triggered on hide of tooltip
});
Expand Down
4 changes: 1 addition & 3 deletions jTippy.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@
$.jTippy.visible.push(helper);
//trigger event on show and pass the tooltip
if( typeof trigger_event === 'undefined' || trigger_event ) {
helper.dom.trigger('jt-show', {
'tooltip': helper.tooltip
});
helper.dom.trigger('jt-show', [helper.tooltip, helper.hide]);
}
},
//is this tooltip visible
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.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"name": "jtippy",
"version": "1.5.0",
"version": "1.6.0",
"description": "jQuery tooltip plugin",
"author": {
"name" : "HTMLGuy, LLC",
"url" : "https://htmlguy.com"
},
"main": "jTippy.min.js",
"repository": {
"type": "git",
Expand All @@ -13,10 +17,7 @@
"homepage": "https://htmlguyllc.github.io/jTippy/",
"private": false,
"dependencies": {
"jquery": "^3.0.0"
"jquery": "^3.4.0"
},
"license": {
"type": "MIT",
"url": "https://www.opensource.org/licenses/mit-license.php"
}
"license": "MIT"
}

0 comments on commit e04dfe6

Please sign in to comment.