r86854 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86853‎ | r86854 | r86855 >
Date:13:15, 25 April 2011
Author:diebuche
Status:resolved (Comments)
Tags:
Comment:
Followup to r86108: jQuery tries to be too smart and converts the string to a number, which breaks the value parser
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.tablesorter.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/jquery/jquery.tablesorter.js
@@ -209,10 +209,8 @@
210210 }
211211
212212 function getElementText( node ) {
213 - var n = $( node );
214 - var sortValue = n.data('sort-value');
215 - if ( typeof sortValue != 'undefined' ) {
216 - return sortValue;
 213+ if ( node.hasAttribute && node.hasAttribute( "data-sort-value" ) ) {
 214+ return node.getAttribute( "data-sort-value" );
217215 } else {
218216 return n.text();
219217 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r86855Followup to r86854: fix $ objectdiebuche13:18, 25 April 2011
r96509Followup to r86108, r86854, r96384: table sorter fetch of 'data-sort-value' a...brion22:03, 7 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86108Followup ro r86088: Use data-sort-type instead of classes to specify the pars...diebuche08:23, 15 April 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   22:12, 7 September 2011

Test cases added in r96384 uncovered an issue with this -- the attribute fetch code was silently falling back to using the text value on IE 6 and 7, which don't have the hasAttribute and getAttribute DOM methods.

r96509 fixes it, yay!

Switched status from OK to Resolved.

Status & tagging log