|
|
@@ -329,6 +329,42 @@ $(document).ready( function () {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ $("#sprint-end-table").on('submit', 'form', function(event) {
|
|
|
+ event.preventDefault();
|
|
|
+
|
|
|
+ var action = $(this).attr('action');
|
|
|
+ var val_field = $(this).find('input[name=time_spent]');
|
|
|
+
|
|
|
+ console.log(action);
|
|
|
+ console.log(val_field.val())
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: action,
|
|
|
+ data : { time_spent : val_field.val() },
|
|
|
+ success: function (response) {
|
|
|
+ val_field.animate({ borderColor: "#009933" }, 1500, function() {
|
|
|
+ val_field.removeAttr('style'); } );
|
|
|
+ },
|
|
|
+ failure: function (response) {
|
|
|
+ val_field.animate({ borderColor: "#ff0000" }, 1500, function() {
|
|
|
+ val_field.removeAttr('style'); } );
|
|
|
+ console.log('Ajax failure: ' + response.responseText);
|
|
|
+ $("#sprint-end-table").unbind('submit'); // Ajax is not working: unbind
|
|
|
+ $(this).submit();
|
|
|
+ },
|
|
|
+
|
|
|
+ error: function (response) {
|
|
|
+ val_field.animate({ borderColor: "#ff0000" }, 1500, function() {
|
|
|
+ val_field.removeAttr('style'); } );
|
|
|
+ console.log('Ajax error: ' + response.responseText);
|
|
|
+ $("#sprint-end-table").unbind('submit'); // Ajax is not working: unbind
|
|
|
+ $(this).submit();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
|
|
|
$("#sprint-end .retro-section input").click(function (event) {
|
|
|
if (confirm('Le sprint courant va être marqué comme terminé, continuer?')) {
|