Skip to content

Instantly share code, notes, and snippets.

@joachimhs
Created August 30, 2012 14:27
Show Gist options
  • Save joachimhs/3529609 to your computer and use it in GitHub Desktop.
Save joachimhs/3529609 to your computer and use it in GitHub Desktop.
Ember.js rerender on window resize issue
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'));
}
@maheshsenni
Copy link

Works like a charm after adding this._super();. Thanks @samselikoff for pointing it out.

@mark-henry
Copy link

@hoIIer
Copy link

hoIIer commented May 17, 2015

@mark-henry how could I use that run-bind to rerender any page in the app on window resize?

@0xcaff
Copy link

0xcaff commented Aug 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment