Added center option - will pass this upstream.
authorTrevor Parscal <tparscal@users.mediawiki.org>
Mon, 6 Dec 2010 21:02:11 +0000 (21:02 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Mon, 6 Dec 2010 21:02:11 +0000 (21:02 +0000)
resources/jquery.tipsy/jquery.tipsy.js

index 4a276e4..847a527 100644 (file)
                 
                 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;
+                       }
                     }
                 }
                 
         fade: true,
         fallback: '',
         gravity: 'n',
+        center: true,
         html: false,
         live: false,
         offset: 0,