Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Anchor scroll offset #9461

Closed

Conversation

petebacondarwin
Copy link
Contributor

No description provided.

@petebacondarwin petebacondarwin self-assigned this Oct 7, 2014
@petebacondarwin petebacondarwin added this to the 1.3.0-rc.5 milestone Oct 7, 2014
@atticoos
Copy link

atticoos commented Oct 7, 2014

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.

@petebacondarwin
Copy link
Contributor Author

@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.

@atticoos
Copy link

atticoos commented Oct 7, 2014

I'm referring to scroll-y-offset-element directive -- isn't this what determines the offset of the scroll?
Might be good to include that this can only be used once per page, as multiple scroll-y-offset-element attributes would conflict the provider's offset. Might want to make it configurable, like
scroll-y-offset-element="hashName" so that it can be applicable to one anchor, or all.

@petebacondarwin
Copy link
Contributor Author

@gkalpak - by the way, I didn't mean to lose your authorship on the commits and I will put that back before we merge

@petebacondarwin
Copy link
Contributor Author

@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.

@atticoos
Copy link

atticoos commented Oct 7, 2014

Oh! I see what you mean now too. You're just adding that offset option to the provider.
I redact my comment! Nice work, 👍

@petebacondarwin
Copy link
Contributor Author

No problem. If only it worked on Firefox and IE: https://travis-ci.org/angular/angular.js/jobs/37292590#L3125

@jeffbcross jeffbcross force-pushed the master branch 2 times, most recently from abdaab7 to 30996f8 Compare October 8, 2014 19:47
@btford btford modified the milestones: 1.3.0-rc.5, 1.3.0-rc.6 Oct 8, 2014
@tbosch
Copy link
Contributor

tbosch commented Oct 9, 2014

Can we close this in favor of #9517

@petebacondarwin petebacondarwin deleted the anchorScrollOffset branch November 24, 2016 09:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants