Skip to content

Commit

Permalink
Calypsoify overrides link targets so they open outside of iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
p-jackson committed Jun 15, 2020
1 parent e165dab commit a21d6fa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ export default function CreatePage( { postType }: Props ) {
);

return (
<Button isPrimary className="wpcom-block-editor-nav-sidebar-create-page" href={ url }>
<Button
target={ applyFilters( 'a8c.WpcomBlockEditorNavSidebar.linkTarget', undefined ) }
isPrimary
className="wpcom-block-editor-nav-sidebar-create-page"
href={ url }
>
{ label }
</Button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export default function ViewAllPosts( { postType }: Props ) {
);

return (
<Button isSecondary className="wpcom-block-editor-nav-sidebar-view-all-posts" href={ url }>
<Button
target={ applyFilters( 'a8c.WpcomBlockEditorNavSidebar.linkTarget', undefined ) }
isSecondary
className="wpcom-block-editor-nav-sidebar-view-all-posts"
href={ url }
>
{ label }
</Button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,13 @@ function getCalypsoUrlInfo( calypsoPort ) {
return url;
}
);

// All links should open outside the iframe
addFilter(
'a8c.WpcomBlockEditorNavSidebar.linkTarget',
'wpcom-block-editor/getSiteSlug',
() => '_parent'
);
}

/**
Expand Down

0 comments on commit a21d6fa

Please sign in to comment.