var item_data = selected_list.data('items');
- var new_item = {
- description: $('#new-list-item input[type="text"]').val().trim(),
- done: $('#new-list-item input[type="checkbox"]').prop('checked'),
- version: 1,
- };
- item_data.items.push(new_item);
- add_list_item(new_item);
+ var new_item = {
+ description: $('#new-list-item input[type="text"]').val().trim(),
+ done: $('#new-list-item input[type="checkbox"]').prop('checked'),
+ version: 1,
+ };
+ item_data.items.push(new_item);
item_data.version = data.version;
+ add_list_item(new_item);
$('#new-list-item input').val('');
}