Merge pull request #464 from lancemanfv/master

Issue #463 fix (adding empty tasks)
This commit is contained in:
Tyler Renelle 2013-02-20 16:03:01 -08:00
commit f3eb07a537

View file

@ -43,8 +43,8 @@ module.exports.app = (appExports, model) ->
list = model.at "_#{type}List"
newModel = model.at('_new' + type.charAt(0).toUpperCase() + type.slice(1))
text = newModel.get()
# Don't add a blank task
if /^(\s)*$/.test(text)
# Don't add a blank task; 20/02/13 Added a check for undefined value, more at issue #463 -lancemanfv
if /^(\s)*$/.test(text) || text == undefined
console.error "Task text entered was an empty string."
return
@ -171,4 +171,4 @@ module.exports.app = (appExports, model) ->
direction = 'up' if direction == 'true/'
direction = 'down' if direction == 'false/'
task = model.at $(el).parents('li')[0]
scoring.score(task.get('id'), direction)
scoring.score(task.get('id'), direction)