All: Resolve most jQuery Migrate warnings

Closes gh-1919
This commit is contained in:
Michał Gołębiowski-Owczarek 2020-05-16 08:36:55 +02:00 committed by GitHub
parent b36d542569
commit f4ef03e57e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 11 additions and 9 deletions

View File

@ -22,7 +22,7 @@
stop: function(event, ui) { stop: function(event, ui) {
tabs.tabs( "refresh" ); tabs.tabs( "refresh" );
if (previouslyFocused) { if (previouslyFocused) {
ui.item.focus(); ui.item.trigger( "focus" );
} }
} }
}); });

View File

@ -12,7 +12,7 @@ QUnit.test( "Disabled button loses focus", function( assert ) {
assert.expect( 2 ); assert.expect( 2 );
var element = $( "#button" ).button(); var element = $( "#button" ).button();
element.focus(); element.trigger( "focus" );
setTimeout( function() { setTimeout( function() {
assert.equal( element[ 0 ], $.ui.safeActiveElement( document ), "Button is focused" ); assert.equal( element[ 0 ], $.ui.safeActiveElement( document ), "Button is focused" );

View File

@ -34,7 +34,7 @@ QUnit.test( "Ensure checked after single click on checkbox label button", functi
var ready = assert.async(); var ready = assert.async();
assert.expect( 2 ); assert.expect( 2 );
$( "#check2" ).checkboxradio().change( function() { $( "#check2" ).checkboxradio().on( "change", function() {
var label = $( this ).checkboxradio( "widget" ); var label = $( this ).checkboxradio( "widget" );
assert.ok( this.checked, "checked ok" ); 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 radio2 = $( "#crazy-form-2" ).checkboxradio();
var radio2Label = radio2.checkboxradio( "widget" ); var radio2Label = radio2.checkboxradio( "widget" );
radio2.change( function() { radio2.on( "change", function() {
assert.ok( this.checked, "#2 checked" ); assert.ok( this.checked, "#2 checked" );
assert.ok( !radio1[ 0 ].checked, "#1 not checked" ); assert.ok( !radio1[ 0 ].checked, "#1 not checked" );

View File

@ -35,7 +35,7 @@ QUnit.test( "Checkbox shows focus when using keyboard navigation", function( ass
var check = $( "#check" ).checkboxradio(), var check = $( "#check" ).checkboxradio(),
label = $( "label[for='check']" ); label = $( "label[for='check']" );
assert.lacksClasses( label, "ui-state-focus" ); assert.lacksClasses( label, "ui-state-focus" );
check.focus(); check.trigger( "focus" );
setTimeout( function() { setTimeout( function() {
assert.hasClasses( label, "ui-state-focus" ); assert.hasClasses( label, "ui-state-focus" );
ready(); ready();

View File

@ -96,7 +96,7 @@ QUnit.test( "active menu item styling", function( assert ) {
setTimeout( function() { setTimeout( function() {
isActive( parentItem ); isActive( parentItem );
isActive( childItem ); isActive( childItem );
element.blur(); element.trigger( "blur" );
setTimeout( function() { setTimeout( function() {
isInactive( parentItem ); isInactive( parentItem );
isInactive( childItem ); isInactive( childItem );

View File

@ -105,6 +105,8 @@ return $.effects.define( "size", function( options, done ) {
to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top; to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top;
to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left; to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left;
} }
delete from.outerHeight;
delete from.outerWidth;
element.css( from ); element.css( from );
// Animate the children if desired // Animate the children if desired

0
ui/safe-offset.js Normal file
View File

View File

@ -263,7 +263,7 @@ $.widget( "ui.button", {
this._toggleClass( null, "ui-state-disabled", value ); this._toggleClass( null, "ui-state-disabled", value );
this.element[ 0 ].disabled = value; this.element[ 0 ].disabled = value;
if ( value ) { if ( value ) {
this.element.blur(); this.element.trigger( "blur" );
} }
} }
}, },

View File

@ -97,7 +97,7 @@ return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
this.labels = this.element.labels().attr( "for", this.ids.button ); this.labels = this.element.labels().attr( "for", this.ids.button );
this._on( this.labels, { this._on( this.labels, {
click: function( event ) { click: function( event ) {
this.button.focus(); this.button.trigger( "focus" );
event.preventDefault(); event.preventDefault();
} }
} ); } );

View File

@ -331,7 +331,7 @@ $.widget( "ui.tooltip", {
position( positionOption.of ); position( positionOption.of );
clearInterval( delayedShow ); clearInterval( delayedShow );
} }
}, $.fx.interval ); }, 13 );
} }
this._trigger( "open", event, { tooltip: tooltip } ); this._trigger( "open", event, { tooltip: tooltip } );