New todo form working with Ajax

This commit is contained in:
Eric Allen 2009-09-21 22:59:46 -04:00
parent e43a7945d5
commit a09b55d6b6
4 changed files with 18 additions and 72 deletions

View file

@ -220,6 +220,15 @@ function setup_container_toggles(){
});
}
function askIfNewContextProvided() {
var givenContextName = $('#todo_context_name').val();
if (givenContextName.length == 0) return true; // do nothing and depend on rails validation error
for (var i = 0; i < contextNames.length; ++i) {
if (contextNames[i] == givenContextName) return true;
}
return confirm('New context "' + givenContextName + '" will be also created. Are you sure?');
}
/* Unobtrusive jQuery behavior */
$(document).ready(function() {