Quickly mixin class helper methods to a view.
$ component install ianstormtaylor/classes
var Classes = require('classes');
/**
* Mixin classes.
*/
Classes(View.prototype);
View.prototype.addClass // fn(name)
View.prototype.removeClass // fn(name)
View.prototype.hasClass // fn(name)
View.prototype.toggleClass // fn(name)
Depends on the view's .el
property being a DOM element reference.
Mix the classes methods into a given obj
.
Adds a class name
to this.el
.
Removes a class name
from this.el
.
Checks whether this.el
has a class name
.
Toggles a class name
on this.el
.
MIT