   up = (e)->
     ls_down = false
     rs_down = false
+    temp = timeline_chart.get_timestamp_range((parseInt ls.css("left")) or 0, parseInt rs.css("left") or max_width)
+    if not (_.isEqual(current_range,temp)) 
+      current_range = temp
+      # deegan
+      console.log Repo.commits.filter (commit) -> 
+        commit.timestamp >= temp[0] and commit.timestamp <= temp[1] 
+      
 
   moved = (e) ->
-    ls.css("left", e.pageX-2.5) if ls_down and e.pageX+5 < (parseInt rs.css("left")) and e.pageX < max_width and e.pageX > min_width
-    rs.css("left", e.pageX-2.5) if rs_down and e.pageX-5 > (parseInt ls.css("left")) and e.pageX < max_width and e.pageX > min_width
+    current_rs_left = parseInt rs.css("left") or 0
+    current_ls_left = parseInt ls.css("left") or max_width
+    ls.css("left", if (e.pageX > max_width) then max_width - 2.5 else e.pageX - 2.5 ) if ls_down and e.pageX+5 < current_rs_left and current_ls_left < max_width and current_ls_left > min_width
+    rs.css("left", if (e.pageX > max_width) then max_width - 2.5 else e.pageX - 2.5 ) if rs_down and e.pageX-5 > current_ls_left and current_rs_left < max_width and current_rs_left > min_width
   ls.on 'mousedown', ls, down
   rs.on 'mousedown', rs, down
-  $(document).on('mouseup', up).on('mousemove', moved).on('mouseenter', up)
+  $(document).on('mouseup', up).on('mousemove', moved).on('mouseleave', up).on('mouseenter', up)
 
 
 settings =

  t.get_timestamp_range = (min_screen_x, max_screen_x) -> 
    a = Math.floor(t.rx min_screen_x)
    b = Math.ceil(t.rx max_screen_x)
    [t.filtered_commits[a].timestamp, t.filtered_commits[b].timestamp]

  # t.x_axis = d3.svg.axis().scale(t.x).orient("bottom")
  # t.y_axis = d3.svg.axis().scale(t.y).orient("left")
  t.sort_timestamp_asc = (a,b) -> a.timestamp-b.timestamp



  timestamp_to_d3: (commit) ->
    debugger if !commit? or !commit.timestamp?
    commit.timestamp = d3.time.format("%Y-%m-%dT%XZ").parse(commit.timestamp)
  calculate_files_of: (commit) ->
    commit.aggregated_additions = d3.sum(commit.files, (file)-> file[1])
