Simplify code per reviewer suggestion

See https://github.com/woocommerce/woocommerce/pull/28058#pullrequestreview-519096925
This commit is contained in:
Rodrigo Primo 2020-11-11 16:09:33 -03:00
parent 291884e154
commit 2399668a05
1 changed files with 2 additions and 2 deletions

View File

@ -1049,10 +1049,10 @@ class WC_Email extends WC_Settings_API {
var hide = '" . esc_js( __( 'Hide template', 'woocommerce' ) ) . "'; var hide = '" . esc_js( __( 'Hide template', 'woocommerce' ) ) . "';
jQuery( 'a.toggle_editor' ).text( view ).click( function() { jQuery( 'a.toggle_editor' ).text( view ).click( function() {
var label = hide;
if ( jQuery( this ).closest(' .template' ).find( '.editor' ).is(':visible') ) { if ( jQuery( this ).closest(' .template' ).find( '.editor' ).is(':visible') ) {
var label = view; var label = view;
} else {
var label = hide;
} }
jQuery( this ).text( label ).closest(' .template' ).find( '.editor' ).slideToggle(); jQuery( this ).text( label ).closest(' .template' ).find( '.editor' ).slideToggle();