From aabc4621acff68fae5da3a3f47f162029bef762b Mon Sep 17 00:00:00 2001 From: Mottie Date: Sat, 16 Nov 2013 13:17:54 -0600 Subject: [PATCH] Storage utility will now accept a table element or jQuery table object --- js/jquery.tablesorter.widgets.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index 31c7b8a3..151c7047 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -69,13 +69,15 @@ ts.themes = { alert(val); // "data1" if saved, or "" if not */ ts.storage = function(table, key, value, options) { + table = $(table)[0]; var cookieIndex, cookies, date, hasLocalStorage = false, values = {}, c = table.config, - id = options && options.id || $(table).attr(options && options.group || - 'data-table-group') || table.id || $('.tablesorter').index( $(table) ), - url = options && options.url || $(table).attr(options && options.page || + $table = $(table), + id = options && options.id || $table.attr(options && options.group || + 'data-table-group') || table.id || $('.tablesorter').index( $table ), + url = options && options.url || $table.attr(options && options.page || 'data-table-page') || c && c.fixedUrl || window.location.pathname; // https://gist.github.com/paulirish/5558557 if ("localStorage" in window) {