Deprecated: Define .hover() using non-deprecated methods

Make the deprecated `.hover()` method not rely on other deprecated
methods: `.mouseenter()` & `.mouseleave()`. Use `.on()` instead.

Closes gh-5251

(cherry picked from commit fd6ffc5eb2)
This commit is contained in:
Michał Gołębiowski-Owczarek 2023-05-22 18:23:19 +02:00 committed by Michał Gołębiowski-Owczarek
parent b473729d0e
commit 7287894f1a
No known key found for this signature in database

View File

@ -28,7 +28,9 @@ jQuery.fn.extend( {
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
return this
.on( "mouseenter", fnOver )
.on( "mouseleave", fnOut || fnOver );
}
} );