<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>public/javascripts/jquery.livequery.min.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,7 +4,7 @@
   &lt;head&gt;
     &lt;title&gt;&lt;%= h(yield(:title) || &quot;Untitled&quot;) %&gt;&lt;/title&gt;
     &lt;%= javascript_include_tag &quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot; %&gt;
-    &lt;%= javascript_include_tag 'application' %&gt;
+    &lt;%= javascript_include_tag 'jquery.livequery.min', 'application' %&gt;
     &lt;%= stylesheet_link_tag 'application' %&gt;
     &lt;%= yield(:head) %&gt;
   &lt;/head&gt;</diff>
      <filename>app/views/layouts/application.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -19,9 +19,9 @@ namespace = &quot;project[tasks_params][#{index}]&quot;
 &lt;% end %&gt;
 &lt;tr id=&quot;&lt;%= id if defined?(id) %&gt;&quot;&gt;
   &lt;td&gt;
-    &lt;%= hidden_field_tag &quot;#{namespace}[id]&quot;, task.id unless task.new_record? %&gt;
+    &lt;%= hidden_field_tag &quot;#{namespace}[id]&quot;, task.id, :class =&gt; '_id' unless task.new_record? %&gt;
     &lt;%= check_box_tag    &quot;#{namespace}[_delete]&quot;, &quot;0&quot;, !task._delete, :class =&gt; '_keep' %&gt;
-    &lt;%= hidden_field_tag &quot;#{namespace}[_delete]&quot;, &quot;1&quot; %&gt;
+    &lt;%= hidden_field_tag &quot;#{namespace}[_delete]&quot;, &quot;1&quot;, :class =&gt; '_delete' %&gt;
   &lt;/td&gt;
   &lt;td&gt;
     &lt;%= text_field_tag   &quot;#{namespace}[name]&quot;, task.name %&gt;</diff>
      <filename>app/views/projects/_edit_task.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,28 +1,33 @@
-// Place your application-specific JavaScript functions and classes here
-// This file is automatically included by javascript_include_tag :defaults
-
-$(document).ready(function() {
-  $('a.add-another').each(function(i, link) {
-    link = $(link);
-    
-    link.show();
+$('a.add-another').livequery(function() {
+  var link = $(this);
+  
+  link.show();
+  
+  var clonable = $('#' + link.attr('rel'));
+  clonable.hide();
+  
+  link.bind('click', function() {
+    clone = clonable.clone().attr('id', '');
+    clone.find('input._keep').attr('checked', true);
     
-    var clonable = $('#' + link.attr('rel'));
-    clonable.hide();
-    
-    link.bind('click', function() {
-      clone = clonable.clone().attr('id', '');
-      clone.find('input._keep').attr('checked', true);
-      
-      var index = parseInt(Math.random()*10000);
-      clone.find('input,select,textarea').each(function(i, obj) {
-        obj.name = obj.name.replace('template', index);
-      });
-      
-      clonable.before(clone.show());
-      return false;
+    var index = parseInt(Math.random()*10000);
+    clone.find('input,select,textarea').each(function(i, obj) {
+      obj.name = obj.name.replace('template', index);
+      obj.id = obj.id.replace('template', index);
     });
-    
+    
+    clonable.before(clone.show());
+    return false;
   });
 });
 
+$('._keep').livequery(function() {
+  var box = $(this);
+  box = $(box);
+  box.bind('change', function() {
+    box.parents('tr').find('input,select,textarea').each(function(i, obj) {
+      obj = $(obj);
+      if (!obj.hasClass('_keep') &amp;&amp; !obj.hasClass('_delete') &amp;&amp; !obj.hasClass('_id')) obj.attr('disabled', !box.attr('checked'));
+    });
+  });
+});</diff>
      <filename>public/javascripts/application.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9e6c46136d92518dd7c0c9338a1b014c3afa80b2</id>
    </parent>
  </parents>
  <author>
    <name>Lance Ivy</name>
    <email>lance@cainlevy.net</email>
  </author>
  <url>http://github.com/cainlevy/complex-form-examples/commit/2b5337a4d166c6e924b9534ae4b726fbdf334d02</url>
  <id>2b5337a4d166c6e924b9534ae4b726fbdf334d02</id>
  <committed-date>2008-12-14T15:03:56-08:00</committed-date>
  <authored-date>2008-12-14T15:03:56-08:00</authored-date>
  <message>javascript usability enhancements - disable a row when the checkbox is unchecked</message>
  <tree>af6b0d1b253f4b1796dfeb97b91427db2d393cc1</tree>
  <committer>
    <name>Lance Ivy</name>
    <email>lance@cainlevy.net</email>
  </committer>
</commit>
