r3417 committed - button: set title-attribute (not tooltip...), apply tooltip plugin to ...

r3417 committed - button: set title-attribute (not tooltip...), apply tooltip plugin to ...


Revision: 3417
Author: joern.zaefferer
Date: Sat Nov 7 03:05:27 2009
Log: button: set title-attribute (not tooltip...), apply tooltip plugin to
all buttons; tooltip: hotfix for fade animation queue issues
http://code.google.com/p/jquery-ui/source/detail?r=3417
Modified:
/branches/dev/tests/visual/button/default.html
/branches/dev/ui/jquery.ui.button.js
/branches/dev/ui/jquery.ui.tooltip.js
=======================================
--- /branches/dev/tests/visual/button/default.html    Thu Oct 1 13:53:32 2009
+++ /branches/dev/tests/visual/button/default.html    Sat Nov 7 03:05:27 2009
@@ -8,6 +8,8 @@
    <script type="text/javascript"
src="../../../external/jquery.metadata.js"></script>
    <script type="text/javascript"
src="../../../ui/jquery.ui.core.js"></script>
    <script type="text/javascript"
src="../../../ui/jquery.ui.button.js"></script>
+    <script type="text/javascript"
src="../../../ui/jquery.ui.position.js"></script>
+    <script type="text/javascript"
src="../../../ui/jquery.ui.tooltip.js"></script>
    <script type="text/javascript">
    $(function() {
        var selection = $("#push button, #ops1, #ops2, #format, #radio, #mode,
#toggle");
@@ -26,6 +28,8 @@
        }, function() {
            selection.buttons("destroy");
        }).click();
+
+        $("button").tooltip();
    });
    </script>
    <style>
=======================================
--- /branches/dev/ui/jquery.ui.button.js    Thu Oct 15 03:05:53 2009
+++ /branches/dev/ui/jquery.ui.button.js    Sat Nov 7 03:05:27 2009
@@ -88,8 +88,8 @@
                this.element
                
    .addClass(multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only")
                    .removeClass("ui-button-text-icons ui-button-text-icon");
-                if (!this.element.attr("tooltip")) {
-                    this.element.attr("tooltip",
this.element.find(".ui-button-text").text());
+                if (!this.element.attr("title")) {
+                    this.element.attr("title",
this.element.find(".ui-button-text").text());
                }
            }
        } else {
=======================================
--- /branches/dev/ui/jquery.ui.tooltip.js    Thu Oct 15 03:05:53 2009
+++ /branches/dev/ui/jquery.ui.tooltip.js    Sat Nov 7 03:05:27 2009
@@ -68,7 +68,7 @@
        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.tooltip.is(':visible') ? this.tooltip.show().fadeTo("normal",
this.opacity) : this.tooltip.fadeIn();
    },
    close: function() {
@@ -79,7 +79,9 @@
        this.tooltip.attr("aria-hidden", "true");
        if (this.tooltip.is(':animated'))
-                this.tooltip.stop().fadeTo("normal", 0);
+                this.tooltip.stop().fadeTo("normal", 0, function() {
+                    $(this).hide();
+                });
            else
                this.tooltip.stop().fadeOut();