Persist diff view toggle with localStorage
This commit is contained in:
parent
e0dbc08072
commit
81dcac4097
|
|
@ -75,9 +75,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
renderAll("side-by-side");
|
||||
const saved = localStorage.getItem("sandlot-unified") === "1";
|
||||
toggle.checked = saved;
|
||||
renderAll(saved ? "line-by-line" : "side-by-side");
|
||||
|
||||
toggle.addEventListener("change", function () {
|
||||
localStorage.setItem("sandlot-unified", this.checked ? "1" : "0");
|
||||
renderAll(this.checked ? "line-by-line" : "side-by-side");
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user