From e87aa26db2146290a4c671e69ae3c94eb7c58056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81?= Date: Wed, 18 Feb 2015 13:08:24 +0300 Subject: [PATCH] Fix some bugs Fix undo option, correct class name for container is "tablescroll", not "tablescroll_wrapper". Fix width edit on first visible item, not first item. --- jquery.tablescroll.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jquery.tablescroll.js b/jquery.tablescroll.js index 7596b3f..648a4ad 100644 --- a/jquery.tablescroll.js +++ b/jquery.tablescroll.js @@ -51,12 +51,13 @@ OTHER DEALINGS IN THE SOFTWARE. if (options == 'undo') { var container = $(this).parent().parent(); - if (container.hasClass('tablescroll_wrapper')) + if (container.hasClass('tablescroll')) { container.find('.tablescroll_head thead').prependTo(this); container.find('.tablescroll_foot tfoot').appendTo(this); container.before(this); container.empty(); + container.remove(); } return; } @@ -124,9 +125,9 @@ OTHER DEALINGS IN THE SOFTWARE. // possible speed enhancements var has_thead = $('thead',tb).length ? true : false ; var has_tfoot = $('tfoot',tb).length ? true : false ; - var thead_tr_first = $('thead tr:first',tb); - var tbody_tr_first = $('tbody tr:first',tb); - var tfoot_tr_first = $('tfoot tr:first',tb); + var thead_tr_first = $('thead tr:visible:first',tb); + var tbody_tr_first = $('tbody tr:visible:first',tb); + var tfoot_tr_first = $('tfoot tr:visible:first',tb); // remember width of last cell var w = 0;