Skip to content

Instantly share code, notes, and snippets.

@yannk
Created March 27, 2013 23:45
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 yannk/5259208 to your computer and use it in GitHub Desktop.
Save yannk/5259208 to your computer and use it in GitHub Desktop.
Ember.Route.reopen({
enter: function() {
this._super();
var cssClass = this.toCssClass();
if (cssClass === 'application') return; // not interesting to us
Ember.$('body').addClass(cssClass);
},
exit: function() {
this._super();
Ember.$('body').removeClass(this.toCssClass());
},
toCssClass: function() {
return this.routeName.dasherize();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment