Commits

Matthew Schinckel committed 4ef409c

Save the days that were selected.

  • Participants
  • Parent commits b1c9d55

Comments (0)

Files changed (1)

File jsonfield/static/js/json-table.js

                         .each(function(i, form){
                             var value = form2object(form);
                             if (value['days'].length){
-                                value['days'] = $.map(value['days'], function(i, el){ return parseInt(el, 10);});
+                                value['days'] = $.map(value['days'], function(i, el){
+                                    return parseInt(i, 10);
+                                });
                             } else {
                                 delete value['days'];
                             }
         $.each(conditionNames, function(i, conditionName){
             conditions[conditionName] = getRules(conditionName);
         });
-        console.log(conditions);
         return conditions;
     }
     
         $table.find('input.cell-value').filter(function(i){
             return $(this).attr('column_id') == column_id;
         }).attr('column', newName);
+        updateSourceFromData();
     }
     
     function updateRowHeader(evt) {
         console.log(newValue);
         $th.find(':input:hidden').val(newValue);
         $th.closest('tr').find('input.cell-value').attr('row', newValue);
+        updateSourceFromData();
     }
     
     function addRule(evt) {
         // Add a new rule to the current condition
         evt.preventDefault();
         $.tmpl($('#rule-template'), defaults.rule).insertBefore($(evt.target))  
+        updateSourceFromData();
     }
     
     function deleteRule(evt) {
     
     $('.toggleHeaderRuleDisplay').live('click', toggleHeaderRuleDisplay);
     
-    $dataSource.hide();
+    // $dataSource.hide();
     
     return $;
 }