1.1.0 • Published 2 years ago
ember-has-scrolled-modifier v1.1.0
ember-has-scrolled-modifier
This addon provides has-scrolled modifier which helps to understand whether the element was scrolled or not.
Compatibility
- Ember.js v3.20 or above
- Ember CLI v3.20 or above
- Node.js v12 or above
Installation
ember install ember-has-scrolled-modifierUsage
has-scrolled modifier accepts two positional arguments:
direction: tracks scroll direction. Possible values are 'vertical', 'horizontal'.callback: will be called when scroll event happened. An object will be passed as an argument with two boolean values:hasScrolled: istrueif the element was scrolled, isfalseotherwise.hasRemainingScroll: istrueif the element has some scroll left, isfalseotherwise.
Both values are false when the element has no scroll.
Contributing
PRs are welcome.
License
This project is licensed under the MIT License.