Skip to content

Instantly share code, notes, and snippets.

@poteto
Last active August 29, 2015 14:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poteto/feff528caae50f1850e6 to your computer and use it in GitHub Desktop.
Save poteto/feff528caae50f1850e6 to your computer and use it in GitHub Desktop.
scrollTimeout: 100,
boundingClientRect: 0,
windowHeight: 0,
windowWidth: 0,
_updateBoundingClientRect: function() {
var el;
el = this.$()[0];
this.set('boundingClientRect', el.getBoundingClientRect());
},
_setup: (function() {
return Ember.run.scheduleOnce('afterRender', this, function() {
this._updateBoundingClientRect();
this.set('windowHeight', window.innerHeight || document.documentElement.clientHeight);
this.set('windowWidth', window.innerWidth || document.documentElement.clientWidth);
});
}).on('didInsertElement'),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment