finish sidepanel toggle. finish document

This commit is contained in:
2020-08-14 11:06:41 +08:00
parent 2238c7154c
commit 2588e3fb41
7 changed files with 134 additions and 37 deletions

View File

@ -17,6 +17,17 @@ $(document).ready(function () {
$(".link-elink").hide();
$(".link-plink").hide();
}
// read sidepanel display property
var sidepanelDisplay = localstorageAssist_Get("ssm-settings-sidepanelDisplay", "true") == "true";
if (sidepanelDisplay){
$("#sidepanelContainer").show();
$("#sidepanelToggle").text(">>>");
} else {
$("#sidepanelContainer").hide();
$("#sidepanelToggle").text("<<<");
}
});
function settingChange(target) {
newValue = $("#sidepanel-display-" + target).prop("checked");
@ -33,6 +44,16 @@ function settingChange(target) {
}
}
}
function sidepanelDisplayChange() {
$("#sidepanelContainer").toggle();
if ($("#sidepanelContainer").is(":hidden")) {
$("#sidepanelToggle").text("<<<");
localstorageAssist_Set("ssm-settings-sidepanelDisplay", false)
} else {
$("#sidepanelToggle").text(">>>");
localstorageAssist_Set("ssm-settings-sidepanelDisplay", true)
}
}
function localstorageAssist_Get(index, defaultValue) {
var cache = localStorage.getItem(index);
if (cache == null) {