mirror of https://github.com/zulip/zulip.git
Change from checking landing page by href to pathname.
Checking by href is a flawed approach due to the fact that hashes are included in the href and will throw off the results of returning the last block in a path. The window.location.pathname property is a much better indicator of the current path.
This commit is contained in:
parent
2d4ba0fde5
commit
4b64ff3752
|
@ -111,7 +111,7 @@ var events = function () {
|
|||
// get the location url like `zulipchat.com/features/`, cut off the trailing
|
||||
// `/` and then split by `/` to get ["zulipchat.com", "features"], then
|
||||
// pop the last element to get the current section (eg. `features`).
|
||||
var location = window.location.href.replace(/\/#*$/, "").split(/\//).pop();
|
||||
var location = window.location.pathname.replace(/\/#*$/, "").split(/\//).pop();
|
||||
|
||||
$("[on-page='" + location + "']").addClass("active");
|
||||
|
||||
|
|
Loading…
Reference in New Issue