-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Anchor scroll offset #9461
Anchor scroll offset #9461
Conversation
Add support for a configurable scroll offset to $anchorScrollProvider. Related to angular#9368 Closes angular#2070 Closes angular#9371
What happens here if there are multiple waypoints on the page that may use desire different offsets? Maybe this is a non issue, but may want to update the provider doc w/ a note that only one offset element may be defined on a page at once. |
dec6049
to
9ef217e
Compare
@ajwhite - if I understand you correctly, what you are asking, is what happens if the offset changes depending upon how far down the page you have scrolled, yes? I think this is supported if you always use the same DOM element to contain whatever is being displayed at the top of the page then pass that to the $anchorScroll service. If you want something more sophisticated you are free to provide a function to the service that can do whatever computation it requires to work out what the current offset is. |
I'm referring to |
@gkalpak - by the way, I didn't mean to lose your authorship on the commits and I will put that back before we merge |
@ajwhite - I see what you mean but that directive is not part of the public API of angular.js. It is just a directive that we wrote for the specific purposes of the angular docs app. |
Oh! I see what you mean now too. You're just adding that offset option to the provider. |
No problem. If only it worked on Firefox and IE: https://travis-ci.org/angular/angular.js/jobs/37292590#L3125 |
abdaab7
to
30996f8
Compare
Can we close this in favor of #9517 |
No description provided.