From 0c6311758339eefe552d249cee9cc1dc25b57ec7 Mon Sep 17 00:00:00 2001 From: La Reclame Date: Tue, 3 Dec 2013 09:35:59 +0100 Subject: [PATCH] Fix #2 - no 'use strict' - mixed spaces and tabs - missing radix parameter and some other jslint errors --- jquery.restable.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/jquery.restable.js b/jquery.restable.js index e4dacfc..083e154 100644 --- a/jquery.restable.js +++ b/jquery.restable.js @@ -1,6 +1,8 @@ -/*! ReStable v0.1 by Alessandro Benoit */ +/*! ReStable v0.1.1 by Alessandro Benoit */ (function ($, window, i) { + 'use strict'; + $.fn.ReStable = function (options) { // Settings @@ -14,7 +16,7 @@ var $cols = [], $result = {}, - $cols_header = $(element).find('tr').first().children('td'), + $cols_header = $(element).find('tr').first().children('td,th'), $row_number = 0, $list; @@ -31,25 +33,23 @@ $(element).find('tr').slice(1).each(function () { var $row = $(this); - $row_number++; + $row_number += 1; $.each($cols, function (index, value) { - index++; + index += 1; if (s.rowHeaders) { - if (!$result[value]) { $result[value] = {}; } + if (!$result[value]) { $result[value] = {}; } $result[value][$row.children('td:nth-child(1)').text()] = $row.children('td:nth-child(' + (index + 1) + ')').text(); } else { - if (!$result[$row_number]) { $result[$row_number] = {}; } + if (!$result[$row_number]) { $result[$row_number] = {}; } $result[$row_number][value] = $row.children('td:nth-child(' + index + ')').text(); } }); }); - - console.log($result); // Crea la lista $list = $('