Skip to content

Commit

Permalink
Merge pull request #622 from mobi/chore_sidenav_external_target
Browse files Browse the repository at this point in the history
[Chore] Sidenav External Target
  • Loading branch information
grahamhency authored Jul 14, 2020
2 parents 7dd93cc + 0a23859 commit 5b8fb36
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
<a class="go-nav-item__link"
*ngIf="navItem.isExternalLink"
[href]="navItem.route"
[target]="navItem.externalLinkTarget ? navItem.externalLinkTarget : '_blank'"
rel="noreferrer">
[target]="navItem.externalLinkTarget ? navItem.externalLinkTarget : '_blank'">
<ng-container *ngTemplateOutlet="navItemInner"></ng-container>
<go-icon *ngIf="(!navItem.externalLinkTarget || navItem.externalLinkTarget === '_blank') && navService.navOpen"
icon="launch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export interface NavItem {
* new tab unless a different target is specified within `externalLinkTarget`.
*/
isExternalLink?: boolean;
externalLinkTarget?: '_self' | '_blank' | '_parent' | '_top';
externalLinkTarget?: '_self' | '_blank' | '_parent' | '_top' | string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class LayoutNavComponent {
* links will open in a new tab unless a different target is specified within externalLinkTarget.
*/
isExternalLink?: boolean;
externalLinkTarget?: '_self' | '_blank' | '_parent' | '_top';
externalLinkTarget?: '_self' | '_blank' | '_parent' | '_top' | string;
}
export interface NavGroup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export class LayoutComponent implements OnInit {
routeTitle: 'External Link (In a New Tab)',
description: 'Test external link opening in new tab',
route: 'https://www.google.com/',
isExternalLink: true
isExternalLink: true,
externalLinkTarget: 'Google'
},
{
routeIcon: 'search',
Expand Down

0 comments on commit 5b8fb36

Please sign in to comment.