]> source.dussan.org Git - jquery-ui.git/commitdiff
Tooltip: Remove core event/alias and deprecated module dependencies
authorAlexander Schmitz <arschmitz@gmail.com>
Thu, 14 May 2015 02:02:14 +0000 (22:02 -0400)
committerAlexander Schmitz <arschmitz@gmail.com>
Wed, 20 May 2015 18:27:57 +0000 (14:27 -0400)
demos/tooltip/forms.html
demos/tooltip/video-player.html
tests/unit/tooltip/core.js
tests/unit/tooltip/events.js
tests/unit/tooltip/options.js
tests/visual/tooltip/tooltip.html

index d93c004ba5c920aade9ff65ff1f8dc4f5081da54..4a593ef512a3260b463fcab9d3a5da528f3e370f 100644 (file)
@@ -36,7 +36,7 @@
                $( "<button>" )
                        .text( "Show help" )
                        .button()
-                       .click(function() {
+                       .on( "click", function() {
                                tooltips.tooltip( "open" );
                        })
                        .insertAfter( "form" );
index 23747bb204fc899a168c1965147dce7f4a4d460a..3d4e467be00b38e25b726d2ffee2e9c89c5c1753 100644 (file)
@@ -74,7 +74,7 @@
                                },
                                text: !!$( this ).attr( "title" )
                        });
-                       button.not( ".menu" ).click(function() {
+                       button.not( ".menu" ).on( "click", function() {
                                notify( button );
                        });
                });
@@ -83,7 +83,7 @@
                });
 
                $( "button.menu" )
-                       .click(function() {
+                       .on( "click", function() {
                                $( document ).tooltip( "close", { currentTarget: this });
                                var menu = $( this ).next().show().position({
                                        my: "left top",
index 135fa480bb87fe332c004966214bbeca8294dbf5..de0b9022493f481d5f45a3512997edcd376b00b5 100644 (file)
@@ -137,20 +137,20 @@ asyncTest( "programmatic focus with async content", function() {
                }
        });
 
-       element.bind( "tooltipopen", function( event ) {
+       element.on( "tooltipopen", function( event ) {
                deepEqual( event.originalEvent.type, "focusin" );
 
-               element.bind( "tooltipclose", function( event ) {
+               element.on( "tooltipclose", function( event ) {
                        deepEqual( event.originalEvent.type, "focusout" );
                        start();
                });
 
                setTimeout(function() {
-                       element.blur();
+                       element.trigger( "blur" );
                });
        });
 
-       element.focus();
+       element.trigger( "focus" );
 });
 
 asyncTest( "destroy during hide animation; only one close event", function() {
@@ -161,7 +161,7 @@ asyncTest( "destroy during hide animation; only one close event", function() {
                hide: true
        });
 
-       element.bind( "tooltipclose", function() {
+       element.on( "tooltipclose", function() {
                ok( true, "tooltip closed" );
        });
 
index a953c6e9140888dacea50ed4d6ed6bad16a14650..d8e9fa2a9288df6986d353ee3975510edc2f3519 100644 (file)
@@ -29,12 +29,12 @@ test( "mouse events", function() {
        expect( 2 );
        var element = $( "#tooltipped1" ).tooltip();
 
-       element.bind( "tooltipopen", function( event ) {
+       element.on( "tooltipopen", function( event ) {
                deepEqual( event.originalEvent.type, "mouseover" );
        });
        element.trigger( "mouseover" );
 
-       element.bind( "tooltipclose", function( event ) {
+       element.on( "tooltipclose", function( event ) {
                deepEqual( event.originalEvent.type, "mouseleave" );
        });
        element.trigger( "focusout" );
@@ -45,12 +45,12 @@ test( "focus events", function() {
        expect( 2 );
        var element = $( "#tooltipped1" ).tooltip();
 
-       element.bind( "tooltipopen", function( event ) {
+       element.on( "tooltipopen", function( event ) {
                deepEqual( event.originalEvent.type, "focusin" );
        });
        element.trigger( "focusin" );
 
-       element.bind( "tooltipclose", function( event ) {
+       element.on( "tooltipclose", function( event ) {
                deepEqual( event.originalEvent.type, "focusout" );
        });
        element.trigger( "mouseleave" );
index d091e3bad4d5633baa6de87b81cbc2f2829aff60..a0730414e81ec51c8f8676220b6158db65a561e5 100644 (file)
@@ -208,7 +208,7 @@ test( "track and programmatic focus", function() {
        expect( 1 );
        $( "#qunit-fixture div input" ).tooltip({
                track: true
-       }).focus();
+       }).trigger( "focus" );
        equal( "inputtitle", $( ".ui-tooltip" ).text() );
 });
 
index 034021cd8ecdbf035de95e9fa1c5394b8fd683cc..c0ba7a11ceab81298bc9c862271e56a414c21adf 100644 (file)
                        show: {
                                delay: 500
                        }
-               }).click(function() {
-                       $( "#focus-on-me" ).focus();
+               }).on( "click", function() {
+                       $( "#focus-on-me" ).trigger( "focus" );
                });
        });
        </script>