Skip to content

Commit c59c5f6

Browse files
authored
Merge pull request #48 from martdegraaf/master
laroute.route now works with subdomains
2 parents b9a905e + c22b5bd commit c59c5f6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/templates/laroute.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@
3131
var uri = this.replaceNamedParameters(route.uri, parameters);
3232
var qs = this.getRouteQueryString(parameters);
3333

34-
return this.getCorrectUrl(uri + qs);
34+
if(this.isOtherHost(route)){
35+
return "//" + route.host + "/" + uri + qs;
36+
}
37+
38+
return this.getCorrectUrl(host + uri + qs);
39+
},
40+
41+
isOtherHost: function (route){
42+
return route.host != window.location.hostname;
3543
},
3644

3745
replaceNamedParameters : function (uri, parameters) {

0 commit comments

Comments
 (0)