Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix emitting remove on rows and document the fix

  • Loading branch information...
commit 6898608843f12c86a45d2165204b5d1f752cba9f 1 parent ea822ca
@substack substack authored
Showing with 15 additions and 2 deletions.
  1. +2 −1  index.js
  2. +1 −1  package.json
  3. +12 −0 readme.markdown
View
3  index.js
@@ -56,8 +56,9 @@ Sorta.prototype.write = function (row) {
}
if (row.value === undefined) {
if (r) {
- self.emit('remove', rows[row.key]);
rows[row.key] = undefined;
+ self.emit('remove', r);
+ r.emit('remove');
var nodes = self.element.childNodes;
for (var i = r.index; i < nodes.length; i++) {
View
2  package.json
@@ -1,6 +1,6 @@
{
"name" : "sorta",
- "version" : "0.0.4",
+ "version" : "0.0.5",
"description" : "preserve the ordering of html elements in the browser as updates stream in",
"main" : "index.js",
"directories" : {
View
12 readme.markdown
@@ -160,6 +160,18 @@ Set a new value for the row object explicitly. This is the same as
Triggered when a row gets updated or created.
+## s.on('remove', function (row) { ... })
+
+Fires when a row gets removed.
+
+## row.on('update', function () { ... })
+
+Fired when a row gets updated.
+
+## row.on('remove', function () { ... })
+
+Fired when a row gets removed.
+
# attributes
## sorta.element
Please sign in to comment.
Something went wrong with that request. Please try again.