cjolif / dojo-todo-app

Dojo ToDo App
Other
28 stars 15 forks source link

In original reminder app ticking an item marked it as completed but does not remove it from the list #28

Closed cjolif closed 12 years ago

cjolif commented 12 years ago

here the item is entirely removed. It should probably just be "ticked" until it is entirely deleted? (delete button).

cjolif commented 12 years ago

More analysis with Ed: On the original application the list is cleared only when switching to another view.

edchat commented 12 years ago

The selected item is being moved to the Completed list immediately, and if an item in the completed list is un-selected it is immediately moved back to it's parent's list. But we could wait until you leave the page to move the items.
In order to do that we would need to be notified when leaving a list, I tried adding beforeDeactivate and afterDeactivate to items/lists.js, but I did not see them being called when transitioning away from the page.

eric-wang commented 12 years ago

If a view transition out, the beforeDeactivate()/afterDeactivate() method will not call. refresh a view only call it's beforeActivate() and afterActicate() methods, here is an operation of refresh the list view.

cjolif commented 12 years ago

Then what is the recommended way to get notified when transitioning out of a view?

edchat commented 12 years ago

So how can a view know that it is being transitioned out?

edchat commented 12 years ago

Ok, so I have more information about beforeDeactivate()/afterDeactivate() being called. If I start out showing a list with #items,list (say Reminders list), and i select "Lists" to go to #configuration,configure. I will not see beforeDeactivate()/afterDeactivate() called in list.js. But it will be called if I select Work Items. That seems odd to me, I would have expected it to be called when going to #configuration,configure, not when going back to #items,list.

edchat commented 12 years ago

With my latest update checked items will be left in the list until an item is selected, it should be moved to the completed list when a different list is selected, but it is not working quite right yet because the deactivate is not getting called until you are going back to the same list. For example, if you bring up the name page with index-phone.html, and go ahead and select Lists and Reminders. Then Check one or more items. Then Select Completed, when you see the Completed list it will be empty, but if you switch back to Reminders, and then back to Completed the items will be there.

eric-wang commented 12 years ago

fixed in commit: https://github.com/cjolif/dojo-todo-app/commit/2d5abb363dbb20cf4291f8e9d5b176acdc4b65d9