Created
August 30, 2012 14:27
-
-
Save joachimhs/3529609 to your computer and use it in GitHub Desktop.
Ember.js rerender on window resize issue
This file contains 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
init: function() { | |
var view = this; | |
var resizeHandler = function() { | |
view.rerender(); | |
}; | |
this.set('resizeHandler', resizeHandler); | |
$(window).bind('resize', this.get('resizeHandler')); | |
}, | |
willDestroy: function() { | |
$(window).unbind('resize', this.get('resizeHandler')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is now a new, clean way to do this: http://emberjs.com/blog/2014/02/12/ember-1-4-0-and-ember-1-5-0-beta-released.html#toc_ember-run-bind