Skip to content

Commit eadc372

Browse files
author
Peter Fu
committed
fix(client:util.urlParse): special treatment for IE
1 parent 50d32aa commit eadc372

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: app/templates/client/components/util/util.service.js

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ function UtilService($window) {
2626
urlParse(url) {
2727
var a = document.createElement('a');
2828
a.href = url;
29+
30+
// IE doesn't populate all link properties when setting .href with a relative URL,
31+
// however .href will return an absolute URL which then can be used on itself
32+
// to populate these additional fields.
33+
// http://stackoverflow.com/a/13405933
34+
if (a.host === '') {
35+
a.href = a.href;
36+
}
37+
2938
return a;
3039
},
3140

0 commit comments

Comments
 (0)