Permalink
Browse files

added clear()

  • Loading branch information...
1 parent e95a8ac commit a1cf94f0f0bc52e6aec445e4bb68c719ed1442c1 @matthewmueller committed Nov 11, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 list.js
View
12 list.js
@@ -95,6 +95,18 @@ List.prototype.push = function(obj, fn, _action) {
};
/**
+ * Clear a list
+ *
+ * @return {List}
+ */
+
+List.prototype.clear = function() {
+ this.el.find('li').remove();
+ this.emit('clear');
+ return this;
+};
+
+/**
* Add an item to the top of the list
*
* @param {Object} obj

0 comments on commit a1cf94f

Please sign in to comment.