ScottLogic/voting-application — pull request #19 by tpkelly (2014-11-03 11:56:32+00:00)
Title: Fix double option creation

Addresses VA-42: "Pressing 'Return' over the 'Add Option' button creates
two options"

Both the trigger for button.data-bind and the row.keypress were calling
self.addOption, but the fields were only being reset after one of the
ajax calls succeeded.

Now, we wipe the fields before doing the request (unless the Name is not
filled in), preventing the second request from going through.