Simplify code per reviewer suggestion
See https://github.com/woocommerce/woocommerce/pull/28058#pullrequestreview-519096925
This commit is contained in:
parent
291884e154
commit
2399668a05
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue