Merge pull request #8115 from annando/path
Use only the first part of the path for the local storage
This commit is contained in:
commit
4a5a74b674
|
@ -40,7 +40,7 @@ function initWidget(inflated, deflated) {
|
||||||
if (!elInf || !elDef) {
|
if (!elInf || !elDef) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (localStorage.getItem(window.location.pathname + ":" + inflated) != "none") {
|
if (localStorage.getItem(window.location.pathname.split("/")[1] + ":" + inflated) != "none") {
|
||||||
elInf.style.display = "block";
|
elInf.style.display = "block";
|
||||||
elDef.style.display = "none";
|
elDef.style.display = "none";
|
||||||
} else {
|
} else {
|
||||||
|
@ -60,11 +60,11 @@ function openCloseWidget(inflated, deflated) {
|
||||||
if (window.getComputedStyle(elInf).display === "none") {
|
if (window.getComputedStyle(elInf).display === "none") {
|
||||||
elInf.style.display = "block";
|
elInf.style.display = "block";
|
||||||
elDef.style.display = "none";
|
elDef.style.display = "none";
|
||||||
localStorage.setItem(window.location.pathname + ":" + inflated, "block");
|
localStorage.setItem(window.location.pathname.split("/")[1] + ":" + inflated, "block");
|
||||||
} else {
|
} else {
|
||||||
elInf.style.display = "none";
|
elInf.style.display = "none";
|
||||||
elDef.style.display = "block";
|
elDef.style.display = "block";
|
||||||
localStorage.setItem(window.location.pathname + ":" + inflated, "none");
|
localStorage.setItem(window.location.pathname.split("/")[1] + ":" + inflated, "none");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue