From 0beb5bf8a53012708d832afd9b7439d2cd7a991f Mon Sep 17 00:00:00 2001 From: Arun P Johny Date: Mon, 18 Mar 2013 15:53:44 +0530 Subject: [PATCH] Add jQuery 1.9 support. Removed support for jQuery < 1.7 and add support for 1.9 Since .live() is removed from 1.9 use .on() to add dynamic object support --- src/javascripts/jquery.tipsy.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/javascripts/jquery.tipsy.js b/src/javascripts/jquery.tipsy.js index f95c063..7ea4c60 100644 --- a/src/javascripts/jquery.tipsy.js +++ b/src/javascripts/jquery.tipsy.js @@ -174,10 +174,13 @@ 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.context).on(eventIn, this.selector, enter).on(eventOut, this.selector, leave); + } else { + this.on(eventIn, enter).on(eventOut, leave); + } } return this;