Skip to content

Commit

Permalink
Close settings when showing help
Browse files Browse the repository at this point in the history
I want the help to be next to the help text to be next to the field it's describing, but that pushes the settings to the right.  I get rid of that annoyance by hiding the settings whenever a help is showing.
  • Loading branch information
alanhkarp committed Oct 26, 2023
1 parent e7b7f8f commit a74622e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/ssp.js
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,6 @@ let SitePasswordWeb = ((function (self) {
settings.xor = JSON.parse("[" + $code.value + "]");
generatePassword();
}
get("codemenu").onmouseleave = function (e) {
menuOff("code", e);
}

$pwlength.onblur = function () {
handleKeyupNumber("pwlength");
Expand Down Expand Up @@ -991,7 +988,6 @@ let SitePasswordWeb = ((function (self) {
get("sitenamemenu").style.display = "none";
get("usernamemenu").style.display = "none";
get("sitepwmenu").style.display = "none";
get("codemenu").style.display = "none";
}
function dotsAllOn() {
get("domainname3bluedots").style.display = "block";
Expand All @@ -1000,7 +996,6 @@ let SitePasswordWeb = ((function (self) {
get("sitename3bluedots").style.display = "block";
get("username3bluedots").style.display = "block";
get("sitepw3bluedots").style.display = "block";
get("code3bluedots").style.display = "block";
}
function helpItemOn(which) {
let $main = get("main");
Expand All @@ -1016,12 +1011,14 @@ let SitePasswordWeb = ((function (self) {
let bottom = $buttons.getBoundingClientRect().bottom + 10;
$element.style.height = bottom - top + "px";
hideInstructions();
hideSettings();
} else {
helpAllOff();
}
}
function helpItemOff(which) {
get(which).style.display = "none";
showSettings();
}
function helpAllOff() {
let helps = document.getElementsByName("help");
Expand Down Expand Up @@ -1080,6 +1077,12 @@ let SitePasswordWeb = ((function (self) {
get("instructionopen").classList.remove("nodisplay");
get("instructionclose").classList.add("nodisplay");
}
function showSettings() {
get("settings").classList.remove("nodisplay");
}
function hideSettings() {
get("settings").classList.add("nodisplay");
}
function hidesitepw() {
if (logging) console.log("checking hidesitepw", get("hidesitepw").checked, SitePassword.database.hidesitepw);
if (get("hidesitepw").checked || (database && SitePassword.database.hidesitepw)) {
Expand Down

0 comments on commit a74622e

Please sign in to comment.