Skip to content
This repository was 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 gkalpak force-pushed the $anchorScroll-explicit-hash branch from dda4c91 to 6b6fef7 Compare November 10, 2014 07:32
@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) ;)

@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch from 6b99562 to 14c5216 Compare November 23, 2014 15:45
@googlebot
Copy link

CLAs look good, thanks!

@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch 3 times, most recently from f9fa6dc to ef451f7 Compare December 1, 2014 09:14
@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch 2 times, most recently from dacfd0a to ab050c4 Compare December 10, 2014 08:56
@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch from ab050c4 to 2068e44 Compare December 19, 2014 10:41
@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch from 2068e44 to ecba1e5 Compare January 20, 2015 11:05
@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch from ecba1e5 to 04cd27f Compare February 19, 2015 08:23
@gkalpak gkalpak force-pushed the $anchorScroll-explicit-hash branch from 04cd27f to 6b2549d Compare March 27, 2015 10:36
return function($anchorScroll) {
$anchorScroll();
$anchorScroll.apply(null, args);
Copy link
Contributor

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
Contributor

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

@petebacondarwin
Copy link
Contributor

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
Contributor

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