From 14f34cbe25323b8b97332544a5e2c62c6531ea27 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 2 May 2012 20:16:40 -0400 Subject: [PATCH] At last, got todoIds working --- src/app/index.coffee | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/app/index.coffee b/src/app/index.coffee index c1d89cb93f..366397d5fd 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -17,7 +17,9 @@ get '/', (page, model) -> money: 0 exp: 0 lvl: 1 - todos: [] + todos: + 0: {id: 0, completed: false, text: 'Example 1'} + todoIds: [0] getRoom page, model, userId getRoom = (page, model, userId) -> @@ -30,14 +32,6 @@ getRoom = (page, model, userId) -> # and their order is stored in an array of ids at '_group.todoIds' model.refList '_todoList', '_user.todos', '_user.todoIds' - # Add some default todos if this is a new group. Items inserted into - # a refList will automatically get an 'id' property if not specified - unless todoIds.get() - model.push '_todoList', - {text: 'Example todo'}, - {text: 'Another example'}, - {text: 'This one is done already', completed: true} - # Create a reactive function that automatically keeps '_remaining' # updated with the number of remaining todos model.fn '_remaining', '_todoList', (list) ->