Patch #1574738 by nod_: rewrite tableheader.js.

PR for https://drupal.org/node/1574738