Skip to content

Instantly share code, notes, and snippets.

@James1x0
Created August 28, 2014 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save James1x0/cf2add7d26327768f7b6 to your computer and use it in GitHub Desktop.
Save James1x0/cf2add7d26327768f7b6 to your computer and use it in GitHub Desktop.
Window prop
export default Ember.View.extend({
didInsertElement: function () {
this.$().on('scroll', { emEl: this }, this._updatePosition);
},
_updatePosition: function ( ev ) {
Ember.run.throttle(ev.data.emEl, function () {
this.set('scrollY', ev.currentTarget.scrollY);
}, 250);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment