(bug 38152) jquery.tablesorter: Use .data() instead of .attr()
authorTimo Tijhof <ttijhof@wikimedia.org>
Tue, 3 Jul 2012 20:55:43 +0000 (22:55 +0200)
committerTimo Tijhof <ttijhof@wikimedia.org>
Wed, 4 Jul 2012 21:11:11 +0000 (23:11 +0200)
commit1f83a2e791a502ba237b8eeb57a6720518419389
tree3b08fda7176c238fcc3d1d128ef465ac524b9f08
parent1d9b4fd4254465ce440421d120cd9c97bc83f8f6
(bug 38152) jquery.tablesorter: Use .data() instead of .attr()

* .data() is faster when looking up repeatedly

* .data() will return the latest value, even if it has changed over
   time, whereas .attr() only gives the value as it was when the page
   was generated. Much like the difference between attr() and prop()
   when it comes to value, checked, disabled etc.

* Moved buildCache() call outside `if ( firstTime )`.
  Tests show that this is fast enough to do on the fly. Left inline
  comment with proposal on how to make this more elaborate in the
  future would it become necessary.

* jquery.tablesorter.test.js:
 - Add tests for bug 38152
 - Clean up double quotes
 - Use more descriptive id (prefix with mw-bug-)

Change-Id: Ie4f801c5b1f93617fd3fd173d2eaaf173a7604e9
RELEASE-NOTES-1.20
resources/jquery/jquery.tablesorter.js
tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js