r73270 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73269‎ | r73270 | r73271 >
Date:08:28, 18 September 2010
Author:nikerabbit
Status:resolved (Comments)
Tags:
Comment:
Allow defining sortable value for table cell with data-sort-value.
This should remove the need to hack around with hidden text and the cell content.
Modified paths:
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -386,6 +386,10 @@
387387 }
388388
389389 window.getInnerText = function( el ) {
 390+ if ( el.getAttribute( 'data-sort-value' ) !== null ) {
 391+ return el.getAttribute( 'data-sort-value' );
 392+ }
 393+
390394 if ( typeof el == 'string' ) {
391395 return el;
392396 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r73272Refactor LanguageStats to use more methods and fix sorting with r73270.nikerabbit08:35, 18 September 2010
r82572Follow-up r73270. Moving the attribute check down to the point where it's for...krinkle20:36, 21 February 2011

Comments

#Comment by TheDJ (talk | contribs)   15:38, 21 February 2011

This operates on the el param, before the 'undefined' check of the el param.

This currently breaks the tablesort code on wmf-deployment for colspan and sortable-bottom cases.

#Comment by Krinkle (talk | contribs)   20:39, 21 February 2011

At the top of the function 'el' could potentially be undefined or a string, in which the member function getAttribute is not available and would raise an error.

Fixed in r82572.

Leaving fixme status since I haven't been able to reproduce the bug TheDJ describes and thus can't say for sure if it's fixed.

Status & tagging log