0.1.1 • Published 5 years ago

ember-windowscroll v0.1.1

Weekly downloads
13
License
MIT
Repository
github
Last release
5 years ago

This addon is deprecated!

Greenkeeper badge Please use ember-windoc instead

ember-windowscroll Build Status

A simple service for consuming the window.onScroll event, and using window.scrollTop in Ember.js apps and addons. The motivation for building this, was to avoid creating very similar services across multiple addons.

Use

Install this addon in your app

ember install ember-windowscroll

Inject the windowscroll service onto something (i.e., a component)

import Ember from 'ember';

const { inject, Component } = Ember;

export default Component.extend({
  windowscroll: inject.service()
})

Then, in your component, you can access the scrollTop property

scrollTopInPx: computed('windowscroll.scrollTop', function() {
  return `${this.get('windowscroll.scrollTop')}px`;
})

or listen to the scroll event

didInsertElement() {
  this._super(...arguments);
  this.get('windowscroll').on('scroll', (e) => {
    console.log('scroll happens');
  });
}

This README outlines the details of collaborating on this Ember addon.

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

0.1.1

5 years ago

0.1.0

5 years ago

0.0.9

7 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago