When a user clicks brewJump or sourceJump, we disallow new jumps until the current scroll operation has finished for 150 ms. Unfortunately the timer being checked was always undefined, so you could keep clicking the jump button and get the brewRenderer or editor to keep bouncing around without finishing the jump action.
This just moves the scrollingTimeout up outside of the listener function so it isn't being reset to undefined every loop.
The function is a simple getter with trivial logic; test is effectively just asserting the size of the map, which coverage adds no meaningful value and adds cruft to the codebase.
Each of the edit/home/new pages renders its save button differently. This makes it a common function with all the same possible render states (does the document have unsaved changes? Is it already saved? Was it auto-saved?).
- Common save button
- Adds the "save" button to /home page which wasn't there before
- Animates the "save" button in /home and /new when the user makes their first change to signal that yes, you do have to actually click the save button if you want to keep this.
- "reminder... you haven't saved for X minutes" still not functional on /new and /home since that involves more moving pieces.
/editPage.jsx uses `unsavedChanges` state to detect when autosave should fire, or unsaved changes warning should display.
/homePage.jsx uses a similar check (different variables) to detect when to show the popup "save now"! button
/newPage.jsx doesn't do any of this, but probably should pop up a warning when saving hasn't happened for a long time
This commit just gives all of the pages the same common `unsavedChanges` state, calculated in the same way, and updates any sections that depend on that updated state.
This is precursor work to adding "unsaved changes" warnings to all three pages.