-
Notifications
You must be signed in to change notification settings - Fork 124
Add sessionStorage based scroll memory for Dartdoc's scrolling divs #1917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f827171
Link to source now works, minus icons
jcollins-g d2e95f6
Merge branch 'master' into link-to-source
jcollins-g 12d9f33
Add material icons
jcollins-g d02577b
Refactor dartdoc_test to avoid asynchronous delete collisions
jcollins-g 1795f69
dartfmt
jcollins-g 3acd727
Fix windows
jcollins-g cf15e98
dartfmt
jcollins-g 74e0cf7
Tweak padding and change icon to description
jcollins-g c7f5ba3
Fix styles to match dartlang site
jcollins-g 102090e
Review comments
jcollins-g ff8c3cc
Add example and use it in the dartdoc package.
jcollins-g f0d6c7e
dartfmt
jcollins-g 9fe1a81
Merge branch 'link-to-source' into link-to-source+hoverlinks
jcollins-g e1e1bb8
Merge branch 'master' into link-to-source
jcollins-g caa58a7
Merge branch 'link-to-source' into link-to-source+hoverlinks
jcollins-g 816fd70
Add lscache and give us some scroll memory
jcollins-g 3baf68b
Review comment
jcollins-g 177b5e8
Merge branch 'style-refresh' into style-refresh+javascript-scroll-memory
jcollins-g 49efcac
Merge branch 'master' into style-refresh
jcollins-g 59b9df6
Merge branch 'style-refresh' into style-refresh+javascript-scroll-memory
jcollins-g cea00d3
Use sessionStorage.
jcollins-g d746206
Merge branch 'master' into style-refresh+javascript-scroll-memory
jcollins-g 8384dd5
Remove setInterval (no longer needed without localStorage)
jcollins-g d03a49d
Merge branch 'master' into style-refresh+javascript-scroll-memory
jcollins-g 1659ded
Use try-finally and ordering to reduce the risk we might generate a b…
jcollins-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks correct, but I can't help but wonder if there are places where this could fall off the rails. If you javascript script didn't run, or threw an exceptions for some reason before it could restore visibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a risk. If the javascript doesn't run due to an exception, the screen becomes blank (indeed, I experienced this when writing the code and accidentally introducing bugs).
The only thing I can think of to reduce that risk is to wrap all our JavaScript in the try of a try/finally with the visibility switch-on occurring in the finally block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've wrapped the restore part that can be wrapped in a try-finally block, and moved it ahead of all the other javascript initialization. This means the page visibly appears slightly faster and should be more resilient to exceptions.