]> git.mxchange.org Git - friendica.git/commitdiff
Use only the first part of the path for the local storage
authorMichael <heluecht@pirati.ca>
Tue, 14 Jan 2020 07:04:42 +0000 (07:04 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 14 Jan 2020 07:04:42 +0000 (07:04 +0000)
view/js/main.js

index fed9cc59f0c9bfa51916aa619fb0367467956e1d..81d26120e7c849922c6411db893e1f4caca731f9 100644 (file)
@@ -40,7 +40,7 @@ function initWidget(inflated, deflated) {
        if (!elInf || !elDef) {
                return;
        }
-       if (localStorage.getItem(window.location.pathname + ":" + inflated) != "none") {
+       if (localStorage.getItem(window.location.pathname.split("/")[1] + ":" + inflated) != "none") {
                elInf.style.display = "block";
                elDef.style.display = "none";
        } else {
@@ -60,11 +60,11 @@ function openCloseWidget(inflated, deflated) {
        if (window.getComputedStyle(elInf).display === "none") {
                elInf.style.display = "block";
                elDef.style.display = "none";
-               localStorage.setItem(window.location.pathname + ":" + inflated, "block");
+               localStorage.setItem(window.location.pathname.split("/")[1] + ":" + inflated, "block");
        } else {
                elInf.style.display = "none";
                elDef.style.display = "block";
-               localStorage.setItem(window.location.pathname + ":" + inflated, "none");
+               localStorage.setItem(window.location.pathname.split("/")[1] + ":" + inflated, "none");
        }
 }