not extensively tested, but seems to work.
take this:
Code:
$(this).bind("click", function(e){
if (e.button==0){
stickytooltip.isdocked=false
stickytooltip.hidebox($, $tooltip)
}
})
and replace it with:
Code:
$(this).bind("click", function(e){
if ( stickytooltip.isdocked ){ // to undock, instead of checking for left click, check if a tooltip is currently docked
stickytooltip.isdocked=false
stickytooltip.hidebox($, $tooltip)
}
})
Then, take this:
Code:
$(this).bind("contextmenu", function(e){
if (stickytooltip.rightclickstick && $(e.target).parents().andSelf().filter(targetselector).length==1){ //if oncontextmenu over a target element
stickytooltip.docktooltip($, $tooltip, e)
return false
}
})
and replace it with:
Code:
$(this).bind("click", function(e){ // bind to click instead of contextmenu
// and check if it is a left click
if (e.button==0 && stickytooltip.rightclickstick && $(e.target).parents().andSelf().filter(targetselector).length==1){
stickytooltip.docktooltip($, $tooltip, e)
return false
}
})
jsfiddle
Bookmarks