From 048ef180bc30bbc3bc437150418200611fd2a857 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Mon, 6 Dec 2010 21:02:11 +0000 Subject: [PATCH] Added center option - will pass this upstream. --- resources/jquery.tipsy/jquery.tipsy.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/jquery.tipsy/jquery.tipsy.js b/resources/jquery.tipsy/jquery.tipsy.js index 4a276e44c8..847a527bec 100644 --- a/resources/jquery.tipsy/jquery.tipsy.js +++ b/resources/jquery.tipsy/jquery.tipsy.js @@ -56,9 +56,17 @@ if (gravity.length == 2) { if (gravity.charAt(1) == 'w') { - tp.left = pos.left + pos.width / 2 - 15; + if ( this.options.center ) { + tp.left = pos.left + pos.width / 2 - 15; + } else { + tp.left = pos.left; + } } else { - tp.left = pos.left + pos.width / 2 - actualWidth + 15; + if ( this.options.center ) { + tp.left = pos.left + pos.width / 2 - actualWidth + 15; + } else { + tp.left = pos.left + pos.width; + } } } @@ -171,6 +179,7 @@ fade: true, fallback: '', gravity: 'n', + center: true, html: false, live: false, offset: 0, -- 2.20.1