HabitRPG/habitrpg — pull request #2296 by SyntaxPickax (2014-01-07 20:18:18+00:00)
Title: Fixed UI issues when editing checklists

Fixes #2182 and #2197. In short:
1. Fixed issue where removeChecklistItem() on backspace/delete key events was splicing out the item instead of letting saveTask prune out the item items.
2. Fixed issue where removeChecklistItem() tried to give focus to an item in an empty list.
2. Fixed keycode typo. The keycode 49 (for the numeral 1) was being used instead of the keycode 46 (for the delete key).

Slightly new behavior introduced:
1. addChecklistItem no longer allows the user to create an empty checklist item.
2. backspace and delete previously removed a list item as soon as it contained no text, making it hard for the user to, for example, correct typos that start at the beginning of the string. Now backspace and delete only remove a list item when either key is pressed in a list item that already contains no text. Delete all the text, then hit delete one more time to back up to the previous list item. This seems more intuitive.

It might be nice in a future commit to add visual cues (like those for the task text) that indicate an empty checklist item (red) or a checklist item that has focus (blue).