Update deprecated jQuery functions for api-keys.js

This commit is contained in:
roykho 2021-02-04 08:08:25 -08:00 committed by Jonathan Sadowski
parent 08aa9e32eb
commit 37f7ccc1f2
1 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@
.on( 'click', css_class, function( evt ) {
evt.preventDefault();
if ( ! document.queryCommandSupported( 'copy' ) ) {
$( css_class ).parent().find( 'input' ).focus().select();
$( css_class ).parent().find( 'input' ).trigger( 'focus' ).trigger( 'select' );
$( '#copy-error' ).text( woocommerce_admin_api_keys.clipboard_failed );
} else {
$( '#copy-error' ).text( '' );
@ -69,10 +69,10 @@
'fadeIn': 50,
'fadeOut': 50,
'delay': 0
} ).focus();
} ).trigger( 'focus' );
} )
.on( 'aftercopyerror', css_class, function() {
$( css_class ).parent().find( 'input' ).focus().select();
$( css_class ).parent().find( 'input' ).trigger( 'focus' ).trigger( 'select' );
$( '#copy-error' ).text( woocommerce_admin_api_keys.clipboard_failed );
} );
},