Skip to content

All: Resolve most jQuery Migrate warnings #1919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/tabs/sortable.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
stop: function(event, ui) {
tabs.tabs( "refresh" );
if (previouslyFocused) {
ui.item.focus();
ui.item.trigger( "focus" );
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/button/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/checkboxradio/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" );

Expand All @@ -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" );

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/checkboxradio/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/menu/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 2 additions & 0 deletions ui/effects/effect-size.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file added ui/safe-offset.js
Empty file.
2 changes: 1 addition & 1 deletion ui/widgets/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion ui/widgets/selectmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
} );
Expand Down
2 changes: 1 addition & 1 deletion ui/widgets/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ $.widget( "ui.tooltip", {
position( positionOption.of );
clearInterval( delayedShow );
}
}, $.fx.interval );
}, 13 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want a comment here why its 13?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. This is copied from the $.fx.interval value & follows the advice from https://github.com/jquery/jquery-migrate/blob/master/warnings.md#jqmigrate-jqueryfxinterval-is-deprecated

}

this._trigger( "open", event, { tooltip: tooltip } );
Expand Down