Refine the FTP credentials form interaction.

Properly toggle SSH2 Authentication Keys fieldset visibility.
JavaScript and CSS clean-up.

Props Mte90.
Fixes #34376.

git-svn-id: https://develop.svn.wordpress.org/trunk@37467 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia
2016-05-19 22:58:55 +00:00
parent c5944fedf8
commit 86b5802d75
3 changed files with 35 additions and 32 deletions
+7 -4
View File
@@ -471,6 +471,9 @@ window.wp = window.wp || {};
$( document ).ready( function() {
// Set initial focus on the first empty form field.
$( '#request-filesystem-credentials-form input[value=""]:first' ).focus();
/*
* Check whether a user needs to submit filesystem credentials based on whether
* the form was output on the page server-side.
@@ -503,10 +506,10 @@ window.wp = window.wp || {};
wp.updates.requestForCredentialsModalCancel();
});
// Hide SSH fields when not selected
$( '#request-filesystem-credentials-dialog input[name="connection_type"]' ).on( 'change', function() {
$( this ).parents( 'form' ).find( '#private_key, #public_key' ).parents( 'label' ).toggle( ( 'ssh' == $( this ).val() ) );
}).change();
// Hide SSH fields when not selected.
$( '#request-filesystem-credentials-form input[name="connection_type"]' ).on( 'change', function() {
$( '#ssh-keys' ).toggleClass( 'hidden', ( 'ssh' !== $( this ).val() ) );
});
// Click handler for plugin updates in List Table view.
$( '.plugin-update-tr' ).on( 'click', '.update-link', function( e ) {