Skip to content

Commit

Permalink
fix(route-href): prefix the pathname for fragment hrefs
Browse files Browse the repository at this point in the history
  • Loading branch information
pat841 committed Sep 20, 2018
1 parent 79ab6ab commit b0d1179
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/route-href.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export class RouteHref {

let href = this.router.generate(this.route, this.params);

// Prefix pathname and search to fragment?
if (href.startsWith('#') && window.location) {
href = `${window.location.origin}${window.location.pathname}${window.location.search}${href}`;
}

if (this.element.au.controller) {
this.element.au.controller.viewModel[this.attribute] = href;
} else {
Expand Down

0 comments on commit b0d1179

Please sign in to comment.