Merge pull request #1283 from MaxLeiter/MaxLeiter/window-save
Add anchor tag to URL to signify open page for reloading
This commit is contained in:
commit
b844b0a782
@ -318,9 +318,9 @@ $(function() {
|
|||||||
|
|
||||||
if (history && history.pushState) {
|
if (history && history.pushState) {
|
||||||
if (data && data.replaceHistory && history.replaceState) {
|
if (data && data.replaceHistory && history.replaceState) {
|
||||||
history.replaceState(state, null, null);
|
history.replaceState(state, null, target);
|
||||||
} else {
|
} else {
|
||||||
history.pushState(state, null, null);
|
history.pushState(state, null, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -486,7 +486,8 @@ $(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if ($("body").hasClass("public")) {
|
|
||||||
|
if ($("body").hasClass("public") && window.location.hash === "#connect") {
|
||||||
$("#connect").one("show", function() {
|
$("#connect").one("show", function() {
|
||||||
var params = URI(document.location.search);
|
var params = URI(document.location.search);
|
||||||
params = params.search(true);
|
params = params.search(true);
|
||||||
|
@ -32,7 +32,10 @@ socket.on("init", function(data) {
|
|||||||
const target = sidebar.find("[data-id='" + id + "']").trigger("click", {
|
const target = sidebar.find("[data-id='" + id + "']").trigger("click", {
|
||||||
replaceHistory: true
|
replaceHistory: true
|
||||||
});
|
});
|
||||||
if (target.length === 0) {
|
const dataTarget = document.querySelector("[data-target='" + window.location.hash + "']");
|
||||||
|
if (window.location.hash && dataTarget) {
|
||||||
|
dataTarget.click();
|
||||||
|
} else if (target.length === 0) {
|
||||||
const first = sidebar.find(".chan")
|
const first = sidebar.find(".chan")
|
||||||
.eq(0)
|
.eq(0)
|
||||||
.trigger("click");
|
.trigger("click");
|
||||||
|
Loading…
Reference in New Issue
Block a user