Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
Changed Toggle navigation shortcut, fix for Url issue
Browse files Browse the repository at this point in the history
Signed-off-by: Milan Klanjsek <mklanjsek@pivotal.io>
  • Loading branch information
mklanjsek committed Oct 20, 2020
1 parent e4b120e commit dcd0781
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ <h3 class="modal-title">Keyboard Shortcuts</h3>
>
<clr-stack-label>Toggle Navigation</clr-stack-label>
<clr-stack-content>
<span class="label">Ctrl Shift<span class="badge">N</span></span>
<span class="label">Ctrl<span class="badge">b</span></span>
</clr-stack-content>
</clr-stack-block>
<clr-stack-block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ export class NavigationService {
this.current.next(update);
this.createModules(update.sections);
if (update.defaultPath) {
this.activeUrl.next(update.defaultPath);
const newUrl = update.defaultPath.startsWith('/')
? update.defaultPath
: '/' + update.defaultPath;
if (newUrl !== this.activeUrl.value) {
this.activeUrl.next(newUrl);
}
}
this.updateLastSelection();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class NavigationComponent implements OnInit, OnDestroy {
event.preventDefault();
event.cancelBubble = true;
this.themeService.switchTheme();
} else if (event.key === 'N' && event.ctrlKey) {
} else if (event.key === 'b' && event.ctrlKey) {
event.preventDefault();
event.cancelBubble = true;
this.updateNavCollapsed(!this.collapsed);
Expand Down

0 comments on commit dcd0781

Please sign in to comment.