Skip to content

Commit

Permalink
Separately scroll instructions and main panel
Browse files Browse the repository at this point in the history
It took me a day to figure out which 5 lines of code I needed to make this work.
  • Loading branch information
alanhkarp committed Oct 27, 2023
1 parent 9b1eff8 commit 18ca95f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ <h1 style="text-align: center;">Settings</h1>
</div>
</div>
<div id="instructionpanel" style="display: none;">
<h2 class="nodisplay">Instructions</h2>
<h1> Instructions</h1>
<div id="sections">
<section id="useinfo" name="instructions">
<svg id="openuse" class="accordian" style="display: block;" width="24px" height="24px" viewBox="0 0 24 24"
Expand Down
4 changes: 4 additions & 0 deletions src/ssp.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,16 @@ body {
background-color: rgb(136, 204, 255, 0%);
width: auto;
padding: 0;
overflow-y: auto;
overflow-x: hidden;
border: 0pt solid #47A;
border-radius: 6pt;
}
#instructionpanel {
flex: 0 0 auto;
padding-left: 1em;
overflow-x: hidden;
overflow-y: scroll;
}
#main {
margin: 0;
Expand Down
6 changes: 3 additions & 3 deletions src/ssp.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ let SitePasswordWeb = ((function (self) {
const $makedefaultbutton = get("makedefaultbutton")
const $downloadbutton = get("downloadbutton");
const $phishing = get("phishing");
const $instructionpanel = get("instructionpanel");
// Fill in default values in case the user has changed them
let defaultsettings = SitePassword.getDefaultSettings();
loadSettingControls(defaultsettings);

// Set size of window for separately scrolling sections
$instructionpanel.style.height = window.innerHeight + "px";
if (bkmkSettings) {
$domainname.value = bkmkSettings.domainname;
$sitename.value = bkmkSettings.sitename;
Expand Down Expand Up @@ -237,7 +239,6 @@ let SitePasswordWeb = ((function (self) {
//$element.focus();
}

const $instructionpanel = get("instructionpanel");
const $maininfo = get("maininfo");
$maininfo.onclick = function () {
if ($instructionpanel.style.display === "none") {
Expand Down Expand Up @@ -1010,7 +1011,6 @@ let SitePasswordWeb = ((function (self) {
let $buttons = get(which + "helptextclose");
let bottom = $buttons.getBoundingClientRect().bottom + 10;
$element.style.height = bottom - top + "px";
hideInstructions();
hideSettings();
} else {
helpAllOff();
Expand Down

0 comments on commit 18ca95f

Please sign in to comment.