Merge pull request #1080 from thelounge/yamanickill/1042-back-twice
Replace the state on init rather than adding a new entry
This commit is contained in:
commit
ba20d4f70e
@ -132,7 +132,9 @@ $(function() {
|
||||
$("#sign-in").remove();
|
||||
|
||||
var id = data.active;
|
||||
var target = sidebar.find("[data-id='" + id + "']").trigger("click");
|
||||
var target = sidebar.find("[data-id='" + id + "']").trigger("click", {
|
||||
replaceHistory: true
|
||||
});
|
||||
if (target.length === 0) {
|
||||
var first = sidebar.find(".chan")
|
||||
.eq(0)
|
||||
@ -820,8 +822,12 @@ $(function() {
|
||||
}
|
||||
|
||||
if (history && history.pushState) {
|
||||
if (data && data.replaceHistory && history.replaceState) {
|
||||
history.replaceState(state, null, null);
|
||||
} else {
|
||||
history.pushState(state, null, null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sidebar.on("click", ".chan, button", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user