Prefer textContent over innerText to allow hidden sort keys to work on Safari.
authorIlmari Karonen <vyznev@users.mediawiki.org>
Tue, 7 Aug 2007 09:17:06 +0000 (09:17 +0000)
committerIlmari Karonen <vyznev@users.mediawiki.org>
Tue, 7 Aug 2007 09:17:06 +0000 (09:17 +0000)
No apparent regressions on Firefox 2.0, Konqueror 3.5.5 or Opera 9.21; not
actually tested on Safari nor IE yet(!).

See also: http://en.wikipedia.org/wiki/Wikipedia:Village_pump_%28technical%29#sortable_wikitables_and_Safari

RELEASE-NOTES
skins/common/wikibits.js

index e844b64..a3a8344 100644 (file)
@@ -366,6 +366,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Fixed a display problem in the E-mail part of the preferences page when
   the E-mail is not confirmed: the notice about it was in the same line as
   a preference.
+* Table sorting JavaScript prefers textContent over innerText to allow hidden
+  sort keys to work on Safari
 
 == API changes since 1.10 ==
 
index 454b733..11ede27 100644 (file)
@@ -999,7 +999,8 @@ function ts_makeSortable(table) {
 function ts_getInnerText(el) {
        if (typeof el == "string") return el;
        if (typeof el == "undefined") { return el };
-       if (el.innerText) return el.innerText;  // Not needed but it is faster
+       if (el.textContent) return el.textContent; // not needed but it is faster
+       if (el.innerText) return el.innerText;     // IE doesn't have textContent
        var str = "";
 
        var cs = el.childNodes;
@@ -1332,4 +1333,4 @@ function addClickHandler( element, handler ) {
 //note: all skins should call runOnloadHook() at the end of html output,
 //      so the below should be redundant. It's there just in case.
 hookEvent("load", runOnloadHook);
-hookEvent("load", mwSetupToolbar);
\ No newline at end of file
+hookEvent("load", mwSetupToolbar);