fix logic for new tab check on edit product page

This commit is contained in:
haszari 2019-07-10 15:05:36 +12:00
parent 5bac98fd80
commit 3e7da11c30
1 changed files with 6 additions and 1 deletions

View File

@ -118,7 +118,12 @@
// By default, CTA links should open in same tab (and feel integrated with Woo). // By default, CTA links should open in same tab (and feel integrated with Woo).
// Exception: when editing products, use new tab. User may have product edits // Exception: when editing products, use new tab. User may have product edits
// that need to be saved. // that need to be saved.
if ( 'editproduct' === context ) { var newTabContexts = [
'product-edit-meta-tab-header',
'product-edit-meta-tab-footer',
'product-edit-meta-tab-body'
];
if ( _.includes( newTabContexts, context ) ) {
linkoutButton.setAttribute( 'target', 'blank' ); linkoutButton.setAttribute( 'target', 'blank' );
} }