Skip to content

Commit

Permalink
Gutenframe: Add the snackbar to the list of link elements that should…
Browse files Browse the repository at this point in the history
… open in the parent frame. (#34104)

Gutenberg v5.9 introduced the snackbar, a new way to display notices to users in the block editor.

This PR ensures the View Post anchor of snackbars will open their link in the parent frame, as we already do with the same link in existing Gutenberg admin notices.
  • Loading branch information
kwight authored and mmtr committed Jun 19, 2019
1 parent fe92f67 commit ad3d04a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/wpcom-block-editor/src/calypso/iframe-bridge-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,8 @@ function handleGoToAllPosts( calypsoPort ) {
*/
function openLinksInParentFrame() {
const viewPostLinkSelectors = [
'.components-notice-list .is-success .components-notice__action.is-link', // View Post link in success notice
'.components-notice-list .is-success .components-notice__action.is-link', // View Post link in success notice, Gutenberg <5.9
'.components-snackbar-list .components-snackbar__content a', // View Post link in success snackbar, Gutenberg >=5.9
'.post-publish-panel__postpublish .components-panel__body.is-opened a', // Post title link in publish panel
'.components-panel__body.is-opened .post-publish-panel__postpublish-buttons a.components-button', // View Post button in publish panel
].join( ',' );
Expand Down

0 comments on commit ad3d04a

Please sign in to comment.