Skip to content

Commit

Permalink
Fix backbone todo example bugs.
Browse files Browse the repository at this point in the history
Fixed:
- New todo not submitting correctly (page refreshes. `preventDefault`
wasn't there.
- Old checked todo being removed will leave the checkmark on the next
todo replacing its position.
- Cannot change todo (`value`'s now a controlled field).
- `autofocus` (should be `autoFocus`, how ironic given the current
situation) on new todo input isn't working. Switched to manual
`focus()` in `componentDidMount` for now.
- More consistent breathing space between lines.
- Gutter at 80.

Added:
- Use todomvc-common base.css. The old one had to change ids to
classes. No longer necessary.
- Give `cx` a better name and move it in `Utils`.
- Trim input upon finishing edit.
- Remove todo if the new edited value is empty.
- Submit edited todo value on input blur.
- README to explain the existence of this example. Being able to
maintain a non-compilant version allows nice deviations from the
todomvc specs, such as animations, in the future.
  • Loading branch information
chenglou committed Sep 7, 2013
1 parent 3cf14e8 commit 78d305e
Show file tree
Hide file tree
Showing 4 changed files with 309 additions and 113 deletions.
3 changes: 3 additions & 0 deletions examples/todomvc-backbone/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TodoMVC-Backbone

This is a lightweight version of TodoMVC. Its primary purpose is to demo the Backbone integration rather than being feature-complete (refer to `todomvc-director` for a full TodoMVC-compilant app).
Loading

0 comments on commit 78d305e

Please sign in to comment.