Skip to content

Releases: DockYard/ember-in-viewport

Updated ember-cli

15 May 14:26
Compare
Choose a tag to compare

This release updates ember-cli to 0.2.4, so we use a new version of ember. ember-suave was also updated.

There are no other changes.

Options fix

04 May 01:59
Compare
Choose a tag to compare

This release contains a bug fix for #19, which was causing an error when options were only being partially set by consuming applications.

Changelog

#20 [BUGFIX] Moved default config into initializer by @poteto

Better butter

29 Apr 17:44
Compare
Choose a tag to compare

This release contains a few bug fixes for #15 and #16, as well as a general formatting cleanup from adding ember-suave to the addon.

Changelog

#14 Enforce style guide by @poteto
#17 [BUGFIX] Set viewportEntered before triggering hook by @poteto
#18 [BUGFIX] Default value for viewportConfig in initializer by @poteto

Configure all the things!

27 Apr 19:09
Compare
Choose a tag to compare

This release adds 2 features:

  1. didScroll{Up,Down,Left,Right} hooks

    You can now subscribe to didScroll{Up,Down,Left,Right} hooks that are
    emitted by the Mixin when the element enters the viewport. This is primarily
    for the purposes of replacing the waypoints library in ember-waypoints to
    use an Ember implementation instead.

    As with any other hook in Ember, you can handle it with:

    export default Ember.Component.extend(InViewportMixin, {
      didScrollUp(direction) {
        console.log(direction); // 'up'
      },
    
      didScrollDown(direction) {
        console.log(direction); // 'down'
      },
    
      didScrollLeft(direction) {
        console.log(direction); // 'left'
      },
    
      didScrollRight(direction) {
        console.log(direction); // 'right'
      }
    });

    There is also a new viewportScrollSensitivity option that affects the above
    behavior.

  2. Global options

    You can set application wide defaults for ember-in-viewport in your app
    (they are still manually overridable inside of a Component). To set new
    defaults, just add a config object to config/environment.js, like so:

    module.exports = function(environment) {
      var ENV = {
        // ...
        viewportConfig: {
          viewportSpy               : false,
          viewportUseRAF            : true,
          viewportScrollSensitivity : 1,
          viewportRefreshRate       : 100,
          viewportListeners         : [],
          viewportTolerance: {
            top    : 0,
            left   : 0,
            bottom : 0,
            right  : 0
          }
        }
      };
    };
Changelog

#13 Application wide defaults by @poteto
#12 Guard against removed element by @LevelbossMike
#11 waypoint hooks first draft by @poteto

Waypoint hooks

25 Apr 03:42
Compare
Choose a tag to compare
Waypoint hooks Pre-release
Pre-release

Install the beta and report if you have any issues.

$ ember install [email protected]

This pre-release adds a feature where you can now subscribe to didScroll{Up,Down,Left,Right} hooks that are emitted by the Mixin when the element enters the viewport. This is primarily for the purposes of replacing the waypoints library in ember-waypoints to use an Ember implementation instead.

As with any other hook in Ember, you can handle it with:

export default Ember.Component.extend(InViewportMixin, {
  didScrollUp() {
    console.log('up');
  },

  didScrollDown() {
    console.log('down');
  },

  didScrollLeft() {
    console.log('left');
  },

  didScrollRight() {
    console.log('right');
  }
});
Changelog

#11 waypoint hooks first draft by @poteto

Actual hooks

24 Apr 16:20
Compare
Choose a tag to compare

With this release, you no longer need to use observers on viewportEntered in your app. The Mixin now emits actual events that you can handle like you would any other native Ember hook:

export default Ember.Component.extend(InViewportMixin, {

  // with prototype extensions disabled
  handleDidEnterViewport: Ember.on('didEnterViewport', function() {
    console.log('entered');
  }),

  handleDidExitViewport: Ember.on('didExitViewport', function() {
    console.log('exited');
  }),

  // with prototype extensions enabled
  handleDidEnterViewport: (function() {
    console.log('entered');
  }).on('didEnterViewport'),

  handleDidExitViewport: (function() {
    console.log('exited');
  }).on('didExitViewport'),

  // method override 
  didEnterViewport() {
    console.log('entered');
  },

  didExitViewport() {
    console.log('exited');
  }
});
Changelog:

#8 Refactor and Evented hooks by @poteto (thanks to @rwjblue for reporting)

Stable API

21 Apr 20:56
Compare
Choose a tag to compare

This release is a simple version bump to 1.0.0 to mark API stability and commitment to SemVer.

Bugfix for top and left tolerance

17 Apr 15:11
Compare
Choose a tag to compare

This release fixes a bug where the top and left tolerances were being incorrectly calculated.

Beta release

16 Apr 19:30
Compare
Choose a tag to compare

This release is the first beta release for ember-in-viewport – the addon is now at a feature complete state and is ready to be tested in your production apps or side projects. Please help out by opening issues if you encounter any problems!

viewportSpy (all modes)

16 Apr 16:12
Compare
Choose a tag to compare

This release fixes an issue with the previous version – the viewportSpy option was only working for fallback mode (i.e. not in rAF mode but using the Ember run loop).

Changelog
  • #4 Register the Component's elementId along with it's rAF call by @poteto