-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(site): Fix navigation toggle to properly open on page refresh. #8842
fix(site): Fix navigation toggle to properly open on page refresh. #8842
Conversation
@crisbeto @EladBezalel @devversion Can you guys run this locally and tell me if you have any issues? It was bugging the crap out of me while I'm testing some other stuff, so I took a bit to fix it :-) |
@topherfangio Just run it locally and it seems to work pretty nicely. Also the animated scroll to the current |
I'll give it a try later, but that seems like a lot of timeouts. Did you try with rAF instead? |
@crisbeto I have not tried with rAF yet. I could give that a go and see if I can make it smoother. |
Worked pretty good on all browsers @topherfangio. An improvement could be to have some nicer easing when scrolling down. You can check the function that we use on progressCircular. It also has a link where you can generate your own easing functions. |
@crisbeto Thanks for testing it! I'll checkout that easing function and see if I can make things a bit smoother. |
5e35102
to
82cd68f
Compare
@crisbeto Updated to use the easing function. Think you could give it another quick test? As a note: I rebased/force-pushed, so you may need to delete/re-checkout the branch. |
|
||
function calculateNewPosition() { | ||
var duration = 1000; | ||
var currentTime = Date.now() - startTime; |
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.
There's $mdUtil.now
for getting the timestamp.
Currently, the navigation groups on the left would have their icon appear to be toggled open, but the actual content would be invisible because the element's height was not being properly set. Fix by setting the height in a `$mdUtil.nextTick()` so that it fires at the appropriate time (and can measure the height). Additionally, add some code to scroll the selected item into view so that users know which page they are visiting. Fixes angular#8841.
82cd68f
to
806f949
Compare
@ThomasBurleson Fixed the few issues @crisbeto mentioned. Ready for your review. |
Currently, the navigation groups on the left would have their icon appear to be toggled open, but the actual content would be invisible because the element's height was not being properly set.
Fix by setting the height in a
$mdUtil.nextTick()
so that it fires at the appropriate time (and can measure the height).Additionally, add some code to scroll the selected item into view so that users know which page they are visiting.
Fixes #8841.