]> source.dussan.org Git - jquery-ui.git/commitdiff
All: Resolve most jQuery Migrate warnings
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Sat, 16 May 2020 06:36:55 +0000 (08:36 +0200)
committerGitHub <noreply@github.com>
Sat, 16 May 2020 06:36:55 +0000 (08:36 +0200)
Closes gh-1919

demos/tabs/sortable.html
tests/unit/button/core.js
tests/unit/checkboxradio/core.js
tests/unit/checkboxradio/events.js
tests/unit/menu/core.js
ui/effects/effect-size.js
ui/safe-offset.js [new file with mode: 0644]
ui/widgets/button.js
ui/widgets/selectmenu.js
ui/widgets/tooltip.js

index 9888cff771e78e3d58766de711a0fc86895bdcd4..81ae22a254684e6652d928acd86a866d37476844 100644 (file)
@@ -22,7 +22,7 @@
                        stop: function(event, ui) {
                                tabs.tabs( "refresh" );
                                if (previouslyFocused) {
-                                       ui.item.focus();
+                                       ui.item.trigger( "focus" );
                                }
                        }
                });
index 13bc94e3386c54e99bae8a4b765b572313105828..98219c66cde76880393a45deccaccec75d74c848 100644 (file)
@@ -12,7 +12,7 @@ QUnit.test( "Disabled button loses focus", function( assert ) {
        assert.expect( 2 );
        var element = $( "#button" ).button();
 
-       element.focus();
+       element.trigger( "focus" );
        setTimeout( function() {
 
                assert.equal( element[ 0 ], $.ui.safeActiveElement( document ), "Button is focused" );
index fe2774d02b11e3641f1eabcebfc010f1f49f0848..39d8c68319d8a5b23f915257ab5d8f3e7f8b5d97 100644 (file)
@@ -34,7 +34,7 @@ QUnit.test( "Ensure checked after single click on checkbox label button", functi
        var ready = assert.async();
        assert.expect( 2 );
 
-       $( "#check2" ).checkboxradio().change( function() {
+       $( "#check2" ).checkboxradio().on( "change", function() {
                var label = $( this ).checkboxradio( "widget" );
                assert.ok( this.checked, "checked ok" );
 
@@ -59,7 +59,7 @@ QUnit.test( "Handle form association via form attribute", function( assert ) {
        var radio2 = $( "#crazy-form-2" ).checkboxradio();
        var radio2Label = radio2.checkboxradio( "widget" );
 
-       radio2.change( function() {
+       radio2.on( "change", function() {
                assert.ok( this.checked, "#2 checked" );
                assert.ok( !radio1[ 0 ].checked, "#1 not checked" );
 
index 9e391897f7d9f4c63c29d21c4537c9cf29bb704b..96580c791270af98ecf1640bdedf2376e69581b1 100644 (file)
@@ -35,7 +35,7 @@ QUnit.test( "Checkbox shows focus when using keyboard navigation", function( ass
        var check = $( "#check" ).checkboxradio(),
                label = $( "label[for='check']" );
        assert.lacksClasses( label, "ui-state-focus" );
-       check.focus();
+       check.trigger( "focus" );
        setTimeout( function() {
                assert.hasClasses( label, "ui-state-focus" );
                ready();
index be68eddca1364b895641419162229fe0b7155c77..8380d66bdafb08b422f0967a1d12015a5fc7ee4b 100644 (file)
@@ -96,7 +96,7 @@ QUnit.test( "active menu item styling", function( assert ) {
                setTimeout( function() {
                        isActive( parentItem );
                        isActive( childItem );
-                       element.blur();
+                       element.trigger( "blur" );
                        setTimeout( function() {
                                isInactive( parentItem );
                                isInactive( childItem );
index 20af227771d7f5823f4757ae31c321d3cdf4faf6..95a1423e683d4036be228e36b29e67869ec85b3b 100644 (file)
@@ -105,6 +105,8 @@ return $.effects.define( "size", function( options, done ) {
                to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top;
                to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left;
        }
+       delete from.outerHeight;
+       delete from.outerWidth;
        element.css( from );
 
        // Animate the children if desired
diff --git a/ui/safe-offset.js b/ui/safe-offset.js
new file mode 100644 (file)
index 0000000..e69de29
index 3def0f9aa494eb0f614a4698904dd110b51de6e9..a4be3c76e1f060d54f4815bb109b1ba0924a0e18 100644 (file)
@@ -263,7 +263,7 @@ $.widget( "ui.button", {
                        this._toggleClass( null, "ui-state-disabled", value );
                        this.element[ 0 ].disabled = value;
                        if ( value ) {
-                               this.element.blur();
+                               this.element.trigger( "blur" );
                        }
                }
        },
index 52139f73eeae06d5863e49d3c503818ad033265f..79e97816bb23ab3e08038c97c755a5abe503bf02 100644 (file)
@@ -97,7 +97,7 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
                this.labels = this.element.labels().attr( "for", this.ids.button );
                this._on( this.labels, {
                        click: function( event ) {
-                               this.button.focus();
+                               this.button.trigger( "focus" );
                                event.preventDefault();
                        }
                } );
index d466410d70b287dd6c35faac1bfe30f3f6bdfe29..1064852691f79683b375f00317303161f711f0c6 100644 (file)
@@ -331,7 +331,7 @@ $.widget( "ui.tooltip", {
                                        position( positionOption.of );
                                        clearInterval( delayedShow );
                                }
-                       }, $.fx.interval );
+                       }, 13 );
                }
 
                this._trigger( "open", event, { tooltip: tooltip } );