angular-ui / ui-scrollpoint

Add a 'ui-scrollpoint' class to elements when the page scrolls past them.
https://htmlpreview.github.io/?https://github.com/angular-ui/ui-scrollpoint/master/demo/index.html
MIT License
28 stars 25 forks source link

Using scrollpoints with variables #5

Closed phurytw closed 8 years ago

phurytw commented 8 years ago

The scrollpoint can be set using the directive scope option. This allows to change the scrollpoint using a variable.

Sample

You can change the value in the input and the scrollpoint will be updated if the entered value is valid.

This is done with a $watch() listener. I also changed the block that sets shift, absolute and fixLimit to accept "absolute" values after render and the whole thing is wrapped into a function that is called whenever the $watch() event is fired.

PowerKiKi commented 8 years ago

I'd expect that the class would be toggled accordingly when the scrollpoint value changes. Right now you have to change the value and then scroll to have any effect on the class.

Also please add demo and tests. And do not include a release in a PR.

phurytw commented 8 years ago

Fixed :ok_hand:

I also added a demo and a test.

PowerKiKi commented 8 years ago

Great, could you please squash commits into only one and force push ? Then i'll merge.

phurytw commented 8 years ago

Done !

PowerKiKi commented 8 years ago

Released as 1.2.0