<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/views/timetables/_schedule_header.html.erb</filename>
    </added>
    <added>
      <filename>public/javascripts/timetable.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -5,6 +5,7 @@
 &lt;% if @display_compare_table == true %&gt;
   
   &lt;%= render :partial =&gt; 'groups/legend' %&gt;
+  &lt;%= render :partial =&gt; 'timetables/schedule_header' %&gt;
 
 	&lt;table id=&quot;schedule&quot; width=&quot;250px&quot; cellspacing=&quot;0&quot;&gt;
 	  &lt;thead&gt;</diff>
      <filename>app/views/groups/_compare_timetables.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,57 +1,4 @@
-&lt;table id=&quot;schedule_header&quot; width=&quot;250px&quot; cellspacing=&quot;0&quot; style=&quot;display:none&quot;&gt;
-  &lt;thead&gt;
-    &lt;tr&gt;
-      &lt;th&gt;&amp;nbsp;&lt;/th&gt;
-      &lt;%- 7.times do |day| -%&gt;
-        &lt;th&gt;&lt;%= Date::DAYNAMES[day] %&gt;&lt;/th&gt;
-      &lt;%- end -%&gt;
-  &lt;/thead&gt;
-&lt;/table&gt;
-&lt;script&gt;
-  function findPos(obj) {
-    var curleft = curtop = 0;
-    if (obj.offsetParent) {
-      do {
-        curleft += obj.offsetLeft;
-        curtop += obj.offsetTop;
-      } while (obj = obj.offsetParent);
-    }
-    return [ curleft, curtop ];
-  }
-
-  schedLeft = schedTop = 0;
-
-  $(document).ready(function() {
-    console.log($('#schedule').width());
-    $('#schedule_header').width($('#schedule').width() + &quot;px&quot;);
-    [ schedLeft, schedTop ] = findPos($('#schedule')[0]);
-    $('#schedule_header').css('left', schedLeft);
-  });
-
-  function scrollTop() {
-    return filterResults (
-    window.pageYOffset ? window.pageYOffset : 0,
-    document.documentElement ? document.documentElement.scrollTop : 0,
-    document.body ? document.body.scrollTop : 0
-    );
-  }
-
-  function filterResults(n_win, n_docel, n_body) {
-    var n_result = n_win ? n_win : 0;
-    if (n_docel &amp;&amp; (!n_result || (n_result &gt; n_docel)))
-    n_result = n_docel;
-    return n_body &amp;&amp; (!n_result || (n_result &gt; n_body)) ? n_body : n_result;
-  }
-
-  $(window).scroll(function() { 
-    console.log(scrollTop());
-    if (scrollTop() &gt; schedTop) {
-      $(&quot;#schedule_header&quot;).appear();
-    } else {
-      $(&quot;#schedule_header&quot;).fade();
-    }
-  });
-&lt;/script&gt;
+&lt;%= render :partial =&gt; 'schedule_header' %&gt;
 
  &lt;table id=&quot;schedule&quot; cellspacing=&quot;0&quot;&gt;
   &lt;thead&gt;</diff>
      <filename>app/views/timetables/_timetable.html.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>048681d70dd02d8a25d6bf6ab960c4002254e172</id>
    </parent>
  </parents>
  <author>
    <name>Andrew Roth</name>
    <email>andrewroth@gmail.com</email>
  </author>
  <url>http://github.com/twinge/ministry-tracker/commit/707c47a00755e40a6879853c004ac837e6942c9a</url>
  <id>707c47a00755e40a6879853c004ac837e6942c9a</id>
  <committed-date>2009-10-26T12:51:35-07:00</committed-date>
  <authored-date>2009-10-26T12:51:35-07:00</authored-date>
  <message>make schedule header work on groups compare sched

- refactored the js out of _timetable.html.erb and into a javascript file
- added a setTimeout that updates the timetable location again, 1 second
  after the initial page load, to handle the change in page that the
  connexionbar causes</message>
  <tree>3d49ebb2781fc6e2597d00ee60d3b7a75501fb7c</tree>
  <committer>
    <name>Andrew Roth</name>
    <email>andrewroth@gmail.com</email>
  </committer>
</commit>
