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')); | |
} |
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
@mark-henry how could I use that run-bind to rerender any page in the app on window resize?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works like a charm after adding
this._super();
. Thanks @samselikoff for pointing it out.