Skip to content

Commit

Permalink
A better version of pull jaz303#144
Browse files Browse the repository at this point in the history
  • Loading branch information
taitems committed Aug 22, 2013
1 parent 3545aa6 commit 2d40b88
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/javascripts/jquery.tipsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,15 @@
if (!options.live) this.each(function() { get(this); });

if (options.trigger != 'manual') {
var binder = options.live ? 'live' : 'bind',
eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
var eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
this[binder](eventIn, enter)[binder](eventOut, leave);

if (!options.live) {
this['bind'](eventIn, enter)['bind'](eventOut, leave);
} else {
$(this.context).on(eventIn, this.selector, enter);
$(this.context).on(eventOut, this.selector, leave);
}
}

return this;
Expand Down

1 comment on commit 2d40b88

@zoltanseer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't this merged? works perfect

Please sign in to comment.