Last active
August 29, 2015 14:13
-
-
Save hergaiety/aca470d01cadb6f9c30d to your computer and use it in GitHub Desktop.
Ember & Foundation... Play nice! Reflow Foundation on every new Ember Render.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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