Skip to content

Commit

Permalink
Navigate back to pages list rather than closing. (#36513)
Browse files Browse the repository at this point in the history
* Navigate back to pages list rather than closing.

* address feedback
  • Loading branch information
obenland authored and marekhrabe committed Oct 4, 2019
1 parent b6ed464 commit 22f736e
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -137,8 +137,12 @@ class PageTemplateModal extends Component {
if ( event.target.matches( 'button.template-selector-item__label' ) ) {
return false;
}
this.setState( { isOpen: false } );

trackDismiss( this.props.segment.id, this.props.vertical.id );

// Try if we have specific URL to go back to, otherwise go to the page list.
const calypsoifyCloseUrl = get( window, [ 'calypsoifyGutenberg', 'closeUrl' ] );
window.top.location = calypsoifyCloseUrl || 'edit.php?post_type=page';
};

getBlocksByTemplateSlug( slug ) {
Expand All @@ -165,6 +169,8 @@ class PageTemplateModal extends Component {
className="page-template-modal"
overlayClassName="page-template-modal-screen-overlay"
shouldCloseOnClickOutside={ false }
// Using both variants here to be compatible with new Gutenberg and old (older than 6.6).
isDismissable={ false }
isDismissible={ false }
>
<IconButton
Expand Down

0 comments on commit 22f736e

Please sign in to comment.