FIX: Logo links to a different domain were broken
This commit is contained in:
parent
6f9a3d1370
commit
4875fe1c3e
|
@ -139,9 +139,7 @@ const DiscourseURL = Ember.Object.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rewrites.forEach(function(rw) {
|
rewrites.forEach(rw => path = path.replace(rw.regexp, rw.replacement));
|
||||||
path = path.replace(rw.regexp, rw.replacement);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.navigatedToPost(oldPath, path)) { return; }
|
if (this.navigatedToPost(oldPath, path)) { return; }
|
||||||
// Schedule a DOM cleanup event
|
// Schedule a DOM cleanup event
|
||||||
|
|
|
@ -48,7 +48,13 @@ export default createWidget('home-logo', {
|
||||||
|
|
||||||
click(e) {
|
click(e) {
|
||||||
if (wantsNewWindow(e)) { return false; }
|
if (wantsNewWindow(e)) { return false; }
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
const a = $(e.target).closest('a')[0];
|
||||||
|
if (a && a.host !== document.location.host) {
|
||||||
|
document.location = a.href;
|
||||||
|
}
|
||||||
|
|
||||||
DiscourseURL.routeTo(this.href());
|
DiscourseURL.routeTo(this.href());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue