Skip to content

Instantly share code, notes, and snippets.

@knu2xs
Last active August 29, 2015 13:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save knu2xs/8697409 to your computer and use it in GitHub Desktop.
Save knu2xs/8697409 to your computer and use it in GitHub Desktop.
add afterRender event hook to ember views primitive
// create after render view event hook to detect when view is finished loading
// http://mavilein.github.io/javascript/2013/08/01/Ember-JS-After-Render-Event/
// https://github.com/emberjs/ember.js/commit/512327c0128f53d4a0d6828ab38f27c6ccf686ec
Ember.View.reopen({
didInsertElement: function () {
this._super();
Ember.run.scheduleOnce('afterRender', this, this.afterRenderEvent);
},
afterRenderEvent: function () {}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment