Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add .addClass(). Closes #2

  • Loading branch information...
commit bbaa90a0ee988b261c462f76a28bbbc16f19a583 1 parent 9a27da7
@tj tj authored
Showing with 18 additions and 1 deletion.
  1. +4 −0 Readme.md
  2. +14 −1 index.js
View
4 Readme.md
@@ -74,6 +74,10 @@ $ npm install dialog-component
Hide the dialog immediately or wait `ms`.
+### Dialog#addClass(name)
+
+ Add class `name`, useful for styling dialogs differently.
+
## License
MIT
View
15 index.js
@@ -126,6 +126,19 @@ Dialog.prototype.closable = function(){
};
/**
+ * Add class `name`.
+ *
+ * @param {String} name
+ * @return {Dialog}
+ * @api public
+ */
+
+Dialog.prototype.addClass = function(name){
+ this.el.addClass(name);
+ return this;
+};
+
+/**
* Set the effect to `type`.
*
* @param {String} type
@@ -135,7 +148,7 @@ Dialog.prototype.closable = function(){
Dialog.prototype.effect = function(type){
this._effect = type;
- this.el.addClass(type);
+ this.addClass(type);
return this;
};
Please sign in to comment.
Something went wrong with that request. Please try again.