From a5abb5060a17ff1cd8e59ab5ede5348da0fca73d Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 12 Apr 2013 11:27:46 -0500 Subject: [PATCH] removed slower find-self method --- js/jquery.tablesorter.js | 4 ++-- js/jquery.tablesorter.widgets.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 6801a2c7..5b96781e 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -663,8 +663,8 @@ j, downTime; // apply event handling to headers c.$headers - // http://stackoverflow.com/questions/5312849/jquery-find-self; andSelf() deprecated in jQuery 1.8 - .find('*')[ $.fn.addBack ? 'addBack': 'andSelf' ]().filter(c.selectorSort) + // http://stackoverflow.com/questions/5312849/jquery-find-self; + .find(c.selectorSort).add( c.$headers.filter(c.selectorSort) ) .unbind('mousedown.tablesorter mouseup.tablesorter sort.tablesorter') .bind('mousedown.tablesorter mouseup.tablesorter sort.tablesorter', function(e, external) { // jQuery v1.2.6 doesn't have closest() diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index 64070f18..056a0d7d 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -816,8 +816,8 @@ ts.addWidget({ .bind('pagerComplete.tsSticky', function(){ resizeHdr(); }); - // set sticky header cell width and link clicks to real header; andSelf() deprecated in jQuery 1.8 - hdrCells.find('*')[ $.fn.addBack ? 'addBack': 'andSelf' ]().filter(c.selectorSort).each(function(i){ + // http://stackoverflow.com/questions/5312849/jquery-find-self; + hdrCells.find(c.selectorSort).add( c.$headers.filter(c.selectorSort) ).each(function(i){ var t = $(this); stkyHdr.children('tr.tablesorter-headerRow').children().eq(i) // clicking on sticky will trigger sort