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

feat($anchorScroll): allow scrolling to a specified element #9596

Closed
wants to merge 1 commit into from

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Oct 13, 2014

Add an optional argument to $anchorScroll() to enable scrolling to an anchor element different than that related to the current value of $location.hash(). If the argument is omitted, the value of $location.hash() will be used instead.

Closes #4568

@tbosch tbosch self-assigned this Oct 13, 2014
@tbosch tbosch modified the milestones: low, Backlog Oct 13, 2014
@tbosch tbosch removed their assignment Oct 13, 2014
@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch 4 times, most recently from 671bf6b to b691f39 Compare October 18, 2014 12:16
@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch 7 times, most recently from b4f3d67 to b00921b Compare October 27, 2014 16:58
@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch 5 times, most recently from d915061 to dda4c91 Compare November 4, 2014 16:33
@gkalpak
Copy link
Member Author

gkalpak commented Nov 10, 2014

Small and safe little feature, with docs and tests - what's not to love about this PR (even Travis likes it) ;)

@googlebot
Copy link

CLAs look good, thanks!

return function($anchorScroll) {
$anchorScroll();
$anchorScroll.apply(null, args);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be so complicated? Could it not simply be:

function callAnchorScroll(hash) {
  return function($anchorScroll) {
    $anchorScroll(hash);
  };
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm...why indeed ?

@petebacondarwin
Copy link
Member

I would make the commit title: feat($anchorScroll): allow scrolling to a specified element

@petebacondarwin
Copy link
Member

If you could deal with the small comments above then LGTM

@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch 3 times, most recently from 3b9232a to d741c09 Compare April 2, 2015 11:35
@gkalpak gkalpak changed the title feat($anchorScroll): add support for scrolling independently of $location.hash() feat($anchorScroll): allow scrolling to a specified element Apr 2, 2015
@petebacondarwin
Copy link
Member

LGTM

Add an optional argument to `$anchorScroll()` to enable scrolling to an
anchor element different than that related to the current value of
`$location.hash()`. If the argument is omitted or is not a string,
the value of `$location.hash()` will be used instead.

Closes angular#4568
@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch from d741c09 to 55f44b7 Compare April 2, 2015 16:46
@gkalpak gkalpak closed this in 731c8b5 Apr 2, 2015
@gkalpak gkalpak deleted the $anchorScroll-explicit-hash branch April 2, 2015 16:55
netman92 pushed a commit to netman92/angular.js that referenced this pull request Aug 8, 2015
Add an optional argument to `$anchorScroll()` to enable scrolling to an
anchor element different than that related to the current value of
`$location.hash()`. If the argument is omitted or is not a string,
the value of `$location.hash()` will be used instead.

Closes angular#4568
Closes angular#9596
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.

Allow $anchorScroll.scroll() independent of location.hash
5 participants