wp/wp-admin/js/color-picker.js
changeset 18 be944660c56a
parent 16 a86126ab1dd4
--- a/wp/wp-admin/js/color-picker.js	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-admin/js/color-picker.js	Wed Sep 21 18:19:35 2022 +0200
@@ -67,7 +67,7 @@
 				 * @return {void}
 				 */
 				change: function( event, ui ) {
-					if ( $.isFunction( self.options.change ) ) {
+					if ( typeof self.options.change === 'function' ) {
 						self.options.change.call( this, event, ui );
 					}
 				},
@@ -101,7 +101,7 @@
 			}
 
 			// Bind the close event.
-			self.close = $.proxy( self.close, self );
+			self.close = self.close.bind( self );
 
 			self.initialValue = el.val();
 
@@ -189,7 +189,7 @@
 				change: function( event, ui ) {
 					self.toggler.css( { backgroundColor: ui.color.toString() } );
 
-					if ( $.isFunction( self.options.change ) ) {
+					if ( typeof self.options.change === 'function' ) {
 						self.options.change.call( this, event, ui );
 					}
 				}
@@ -232,7 +232,7 @@
 			 *
 			 * @since 3.5.0
 			 */
-			self.toggler.click( function(){
+			self.toggler.on( 'click', function(){
 				if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
 					self.close();
 				} else {
@@ -250,14 +250,14 @@
 			 *
 			 * @return {void}
 			 */
-			self.element.change( function( event ) {
+			self.element.on( 'change', function( event ) {
 				var me = $( this ),
 					val = me.val();
 
 				if ( val === '' || val === '#' ) {
 					self.toggler.css( 'backgroundColor', '' );
 					// Fire clear callback if we have one.
-					if ( $.isFunction( self.options.clear ) ) {
+					if ( typeof self.options.clear === 'function' ) {
 						self.options.clear.call( this, event );
 					}
 				}
@@ -272,12 +272,12 @@
 			 *
 			 * @return {void}
 			 */
-			self.button.click( function( event ) {
+			self.button.on( 'click', function( event ) {
 				var me = $( this );
 				if ( me.hasClass( 'wp-picker-clear' ) ) {
 					self.element.val( '' );
 					self.toggler.css( 'backgroundColor', '' );
-					if ( $.isFunction( self.options.clear ) ) {
+					if ( typeof self.options.clear === 'function' ) {
 						self.options.clear.call( this, event );
 					}
 				} else if ( me.hasClass( 'wp-picker-default' ) ) {