Skip to content

Commit

Permalink
replace innerHTML with .html(). Fixes #385.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Oct 18, 2013
1 parent 340fdf0 commit fdc698c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/jquery.tablesorter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**!
* TableSorter 2.11.1 - Client-side table sorting with ease!
* TableSorter 2.12.0 - Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
* Copyright (c) 2007 Christian Bach
Expand All @@ -24,7 +24,7 @@

var ts = this;

ts.version = "2.11.1";
ts.version = "2.12.0";

ts.parsers = [];
ts.widgets = [];
Expand Down Expand Up @@ -411,14 +411,14 @@
c.$headers = $(table).find(c.selectorHeaders).each(function(index) {
$t = $(this);
ch = c.headers[index];
c.headerContent[index] = this.innerHTML; // save original header content
c.headerContent[index] = $(this).html(); // save original header content
// set up header template
t = c.headerTemplate.replace(/\{content\}/g, this.innerHTML).replace(/\{icon\}/g, i);
t = c.headerTemplate.replace(/\{content\}/g, $(this).html()).replace(/\{icon\}/g, i);
if (c.onRenderTemplate) {
h = c.onRenderTemplate.apply($t, [index, t]);
if (h && typeof h === 'string') { t = h; } // only change t if something is returned
}
this.innerHTML = '<div class="tablesorter-header-inner">' + t + '</div>'; // faster than wrapInner
$(this).html('<div class="tablesorter-header-inner">' + t + '</div>'); // faster than wrapInner

if (c.onRenderHeader) { c.onRenderHeader.apply($t, [index]); }

Expand Down

0 comments on commit fdc698c

Please sign in to comment.