Merge pull request #1657 from me7/Fix-todomvc-state.update-and-ui.save
Fix todomvc state.update and ui.save
This commit is contained in:
commit
b71d437fa7
1 changed files with 2 additions and 2 deletions
|
|
@ -38,7 +38,7 @@ var state = {
|
||||||
update: function(title) {
|
update: function(title) {
|
||||||
if (state.editing != null) {
|
if (state.editing != null) {
|
||||||
state.editing.title = title.trim()
|
state.editing.title = title.trim()
|
||||||
if (state.editing.title === "") destroy(state.editing)
|
if (state.editing.title === "") state.destroy(state.editing)
|
||||||
state.editing = null
|
state.editing = null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -104,7 +104,7 @@ var Todos = {
|
||||||
m("label", {ondblclick: function() {state.dispatch("edit", [todo])}}, todo.title),
|
m("label", {ondblclick: function() {state.dispatch("edit", [todo])}}, todo.title),
|
||||||
m("button.destroy", {onclick: function() {state.dispatch("destroy", [todo])}}),
|
m("button.destroy", {onclick: function() {state.dispatch("destroy", [todo])}}),
|
||||||
]),
|
]),
|
||||||
m("input.edit", {onupdate: function(vnode) {ui.focus(vnode, todo)}, onkeypress: ui.save, onblur: ui.save})
|
m("input.edit", {onupdate: function(vnode) {ui.focus(vnode, todo)}, onkeyup: ui.save, onblur: ui.save})
|
||||||
])
|
])
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue