From e8c88ed1a95e8c2082b26cf2e63a1e7c77eea4b5 Mon Sep 17 00:00:00 2001 From: Luke Andrews Date: Tue, 2 Apr 2013 14:51:26 -0700 Subject: [PATCH 1/3] Updated Tipsy to work with jQuery 1.9, which breaks the .live() method --- src/javascripts/jquery.tipsy.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/javascripts/jquery.tipsy.js b/src/javascripts/jquery.tipsy.js index f95c063..c72e849 100644 --- a/src/javascripts/jquery.tipsy.js +++ b/src/javascripts/jquery.tipsy.js @@ -1,7 +1,8 @@ // tipsy, facebook style tooltips for jquery -// version 1.0.0a // (c) 2008-2010 jason frame [jason@onehackoranother.com] // released under the MIT license +// Forked by Luke Andrews to remain compatible with jQuery 1.9+ +// https://github.com/attaboy/tipsy (function($) { @@ -14,6 +15,15 @@ if (ele == document) return true; } return false; + } + + function jQueryDelegateEventMethod() { + var majorVersionNumber = parseFloat($().jquery); + if majorVersionNumber >= 1.7 { + return 'on'; + } else { + return 'live'; + } }; function Tipsy(element, options) { @@ -174,7 +184,7 @@ if (!options.live) this.each(function() { get(this); }); if (options.trigger != 'manual') { - var binder = options.live ? 'live' : 'bind', + var binder = options.live ? jQueryDelegateEventMethod() : 'bind', eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; this[binder](eventIn, enter)[binder](eventOut, leave); From cd87766c8e10f32ffbe4905c71c7e9de5facba17 Mon Sep 17 00:00:00 2001 From: Luke Andrews Date: Tue, 2 Apr 2013 14:54:38 -0700 Subject: [PATCH 2/3] Oops: fixed missing parens on if statement --- src/javascripts/jquery.tipsy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/javascripts/jquery.tipsy.js b/src/javascripts/jquery.tipsy.js index c72e849..fc4c6e3 100644 --- a/src/javascripts/jquery.tipsy.js +++ b/src/javascripts/jquery.tipsy.js @@ -19,12 +19,12 @@ function jQueryDelegateEventMethod() { var majorVersionNumber = parseFloat($().jquery); - if majorVersionNumber >= 1.7 { + if (majorVersionNumber >= 1.7) { return 'on'; } else { return 'live'; } - }; + } function Tipsy(element, options) { this.$element = $(element); From 191ac261da6a37930ea945a56af6f81b9212a553 Mon Sep 17 00:00:00 2001 From: Luke Andrews Date: Tue, 2 Apr 2013 15:03:16 -0700 Subject: [PATCH 3/3] Restore original version number and copyright --- src/javascripts/jquery.tipsy.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/javascripts/jquery.tipsy.js b/src/javascripts/jquery.tipsy.js index fc4c6e3..6e7be33 100644 --- a/src/javascripts/jquery.tipsy.js +++ b/src/javascripts/jquery.tipsy.js @@ -1,8 +1,7 @@ // tipsy, facebook style tooltips for jquery +// version 1.0.0a // (c) 2008-2010 jason frame [jason@onehackoranother.com] // released under the MIT license -// Forked by Luke Andrews to remain compatible with jQuery 1.9+ -// https://github.com/attaboy/tipsy (function($) {