 
 
 color_table = ->
-  $('tr').mouseenter ->
+  $('tr').unbind('mouseenter.pixel1')
+  $('tr').bind('mouseenter.pixel1', ->
     for cell in $(this).find('.pxl-histogram')
       color_cell(cell,'#F5F5F5')
-  $('tr').mouseleave ->
+  )
+  $('tr').unbind('mouseleave.pixel1')
+  $('tr').bind('mouseleave.pixel1', ->
     for cell in $(this).find('.pxl-histogram')
       color_cell(cell,'#FFF')
+  )
   bgcolor = '#FFF'
   for cell in document.getElementsByClassName('pxl-histogram')
     color_cell(cell,bgcolor)


color_cell = (cell,bgcolor) ->
  return if !cell.firstChild # Exits if the cell is empty
  percentage = $(cell).data('pxl-meta')
  if percentage < 80
    color = '#BFB'

  # Function for sorting on metadata
  pxl_meta = (node) ->
    if($(node).hasClass('pxl-meta'))
      $(node).removeData('pxl-meta') # This clears the jQuery cache, allowing it to see the values updated by d3
      $(node).data('pxl-meta')
    else
      node.innerText
