Skip to content

Commit b7f142e

Browse files
committed
Set Merchant account details selector as toggle
1 parent af05887 commit b7f142e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

includes/class-wc-gateway-amazon-payments-advanced-abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public function get_form_fields() {
389389
),
390390
'manual_notice' => array(
391391
'type' => 'custom',
392-
'html' => '<p>Problems with automatic setup? <a href="#" class="wcapa-toggle-section" data-toggle="#manual-settings-container, #automatic-settings-container">Click here</a> to manually enter your keys.</p>',
392+
'html' => '<p>Problems with automatic setup? Toggle here <a href="#" class="wcapa-toggle-section" data-toggle="#manual-settings-container, #automatic-settings-container"><span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr( __( 'Manually enter your keys', 'woocommerce-gateway-amazon-payments-advanced' ) ) . '">' . esc_attr__( 'Yes', 'woocommerce' ) . '</span></a> to manually enter your keys.</p>',
393393
),
394394
'manual_container_start' => array(
395395
'type' => 'custom',

src/js/non-block/amazon-wc-admin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@
351351
toggle_visibility: function( e ) {
352352
e.preventDefault();
353353
var target = $( $( this ).data( 'toggle' ) );
354+
$(this).find( 'span' ).toggleClass( 'woocommerce-input-toggle--disabled', 'woocommerce-input-toggle--enabled' );
354355
target.toggleClass( 'hidden' );
355356
if ( ! $( this ).hasClass( 'wcapa-toggle-scroll' ) ) {
356357
return;

src/sass/style-admin.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
.json_key_valid {
66
border: 1px solid #18ff59;
77
}
8+
9+
.wcapa-toggle-section:focus {
10+
outline: 0;
11+
box-shadow: none
12+
}

0 commit comments

Comments
 (0)