Hopefully fix history state.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
814b43e43d
commit
489ec3a7df
10
index.js
10
index.js
@ -9,6 +9,7 @@ var SortOrderBStateI = true
|
|||||||
var SortOrderEnabled = false
|
var SortOrderEnabled = false
|
||||||
var SortValue = ""
|
var SortValue = ""
|
||||||
var OrderValue = ""
|
var OrderValue = ""
|
||||||
|
var ReplaceNeeded = true
|
||||||
function SetupJS() {
|
function SetupJS() {
|
||||||
SetupIndexArray()
|
SetupIndexArray()
|
||||||
SetupJSTheme()
|
SetupJSTheme()
|
||||||
@ -78,11 +79,16 @@ function PushHistory(url) {
|
|||||||
var s = true
|
var s = true
|
||||||
if (window.history) {
|
if (window.history) {
|
||||||
if (window.history.pushState) {
|
if (window.history.pushState) {
|
||||||
window.history.pushState({
|
var objectData = {
|
||||||
light: !!document.getElementById("so-theme"),
|
light: !!document.getElementById("so-theme"),
|
||||||
order: document.getElementById("so-order").value,
|
order: document.getElementById("so-order").value,
|
||||||
sort: document.getElementById("so-sort").value
|
sort: document.getElementById("so-sort").value
|
||||||
}, "", url);
|
};
|
||||||
|
if (ReplaceNeeded) {
|
||||||
|
window.history.replaceState(objectData, "", url);
|
||||||
|
ReplaceNeeded = false
|
||||||
|
}
|
||||||
|
window.history.pushState( objectData, "", url);
|
||||||
s = false
|
s = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user