Skip to content

Commit

Permalink
Added Maker#addClass
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Nov 8, 2011
1 parent 9115d4b commit 878ce67
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions jquery.maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@
return this.setAttribute("class", value);
}

/**
* Adds a class name to any previous value that may already exist.
*/
Maker.prototype.addClass = function (value) {
var className = this.attributes["class"];

if (className) {
return this.className(className + " " + value);
}

return this.className(value);
}

/**
* Sugar for setAttribute("text", value).
*/
Expand Down

0 comments on commit 878ce67

Please sign in to comment.