r3448 committed - tooltip: fix for callout prototype: center tooltip vertically and trig...

r3448 committed - tooltip: fix for callout prototype: center tooltip vertically and trig...


Revision: 3448
Author: joern.zaefferer
Date: Thu Nov 12 23:55:25 2009
Log: tooltip: fix for callout prototype: center tooltip vertically and
trigger show event after setting the element to display:block to ensure
that the dimension-calculations are correct
http://code.google.com/p/jquery-ui/source/detail?r=3448
Modified:
/branches/dev/ui/jquery.ui.tooltip.js
=======================================
--- /branches/dev/ui/jquery.ui.tooltip.js    Thu Nov 12 13:51:36 2009
+++ /branches/dev/ui/jquery.ui.tooltip.js    Thu Nov 12 23:55:25 2009
@@ -59,7 +59,6 @@
        if (!content)
            return;
-        this._trigger("show", null, { target: target });
        target.removeAttr("title");
        this.tooltipContent.html(content);
@@ -69,11 +68,13 @@
        this.tooltip.attr("aria-hidden", "false");
        target.attr("aria-describedby", this.tooltip.attr("id"));
-
+
        if (this.tooltip.is(":animated"))
            this.tooltip.stop().show().fadeTo("normal", this.opacity);
        else
            this.tooltip.is(':visible') ? this.tooltip.fadeTo("normal",
this.opacity) : this.tooltip.fadeIn();
+
+        this._trigger("show", null, { target: target });
    },
    close: function() {
@@ -100,9 +101,9 @@
        return $(this).attr("title");
    },
    position: {
-        my: "left top",
+        my: "left center",
        at: "right center",
-        offset: "15 -12"
+        offset: "15 0"
    }
}