Skip to content

Instantly share code, notes, and snippets.

@hergaiety
Last active August 29, 2015 14:13
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 hergaiety/aca470d01cadb6f9c30d to your computer and use it in GitHub Desktop.
Save hergaiety/aca470d01cadb6f9c30d to your computer and use it in GitHub Desktop.
Ember & Foundation... Play nice! Reflow Foundation on every new Ember Render.
// Thanks to @intuitivepixel for the original code to inspire this
/**
* EMBER APPLICATION DEFINITION
*/
window.App = Ember.Application.create();
/**
* INITIALIZE FOUNDATION
*/
$(document).foundation();
// Modify Ember's Views
Ember.View.reopen({
// Every Render...
render: function(buffer) {
// Call the original render functionality
this._super(buffer);
// Next run loop...
Ember.run.once(this, function(){
// Reflow Foundation
$(document).foundation('reflow');
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment