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

ANCHOR SCROLL: docs app: adjust scroll offset to account for header #9360

Closed
IgorMinar opened this issue Oct 1, 2014 · 3 comments
Closed

Comments

@IgorMinar
Copy link
Contributor

go to https://docs.angularjs.org/api/ng/service/$animate#removeClass and you'll see that the scroll position is not right because it doesn't account for the app header.

we could use the solution described here to fix this: #2070 (comment)

@IgorMinar
Copy link
Contributor Author

@petebacondarwin can you take a look at this please?

if the proposed solution works we should close #2070 and point to the fix as an example of how people can use it in their apps too.

@IgorMinar
Copy link
Contributor Author

if this can't be done within rc.5 time frame please let me know

petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 1, 2014
gkalpak added a commit to gkalpak/angular.js that referenced this issue Oct 1, 2014
Add support for a configurable scroll offset to $anchorScrollProvider.
The offset is expressed in pixels and can be specified either as a fixed
value or as a function that return the offset it pixels dynamically.
(This is a POC and a WIP: no docs, no tests)

Related to angular#9368

Closes angular#2070, angular#9360
@gkalpak
Copy link
Member

gkalpak commented Oct 1, 2014

@IgorMinar , @petebacondarwin:

I created a POC PR for adding a configurable scroll offset to $anchorScroll: #9371
It is still a WIP (so no docs and no tests yet).

I also configured the docs app:
If the header's positioning is 'fixed' (in large screens), the offset will successfully account for the header's (variable) height. If the positioning is 'static' (in smaller screens) then the offset returned is 0.

It seems to work nicely in every situation (all screen sizes and all elements (<li>s included).

WDYT ?

Pleae, don't scream about how I get a hold on the header element. It's a super-temporary, ugly, POCy hack :)

petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 1, 2014
@petebacondarwin petebacondarwin changed the title docs app: adjust scroll offset to account for header ANCHOR SCROLL: docs app: adjust scroll offset to account for header Oct 1, 2014
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Oct 2, 2014
Add support for a configurable scroll offset to $anchorScrollProvider.
The offset is expressed in pixels and can be specified either as a fixed
value or as a function that return the offset it pixels dynamically.
(This is a POC and a WIP: no docs, no tests)

Related to angular#9368

Closes angular#2070, angular#9360
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 7, 2014
@btford btford modified the milestones: 1.3.0-rc.5, 1.3.0-rc.6 Oct 8, 2014
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 9, 2014
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 9, 2014
gkalpak added a commit to gkalpak/angular.js that referenced this issue Oct 9, 2014
Add support for a configurable scroll offset to $anchorScrollProvider.
The offset is expressed in pixels and can be specified either as a fixed
value or as a function that return the offset it pixels dynamically.
(This is a POC and a WIP: no docs, no tests)

Related to angular#9368

Closes angular#2070, angular#9360
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Oct 9, 2014
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 9, 2014
gkalpak added a commit to gkalpak/angular.js that referenced this issue Oct 9, 2014
Add support for a configurable scroll offset to $anchorScrollProvider.
The offset is expressed in pixels and can be specified either as a fixed
value or as a function that return the offset it pixels dynamically.
(This is a POC and a WIP: no docs, no tests)

Related to angular#9368

Closes angular#2070, angular#9360
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Oct 9, 2014
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 9, 2014
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 9, 2014
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Oct 9, 2014
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 9, 2014
gkalpak added a commit to gkalpak/angular.js that referenced this issue Oct 10, 2014
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
gkalpak pushed a commit to gkalpak/angular.js that referenced this issue Oct 10, 2014
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Oct 10, 2014
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 10, 2014
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Oct 10, 2014
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 10, 2014
gkalpak added a commit to gkalpak/angular.js that referenced this issue Oct 10, 2014
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
gkalpak pushed a commit to gkalpak/angular.js that referenced this issue Oct 10, 2014
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this issue Oct 10, 2014
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 10, 2014
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Oct 12, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.