From: Ilmari Karonen Date: Tue, 7 Aug 2007 09:17:06 +0000 (+0000) Subject: Prefer textContent over innerText to allow hidden sort keys to work on Safari. X-Git-Tag: 1.31.0-rc.0~51842 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=98c77810f884b711324576747763506179b9ef5b;p=lhc%2Fweb%2Fwiklou.git Prefer textContent over innerText to allow hidden sort keys to work on Safari. 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 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e844b6462b..a3a83443e7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index 454b733b81..11ede270fe 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -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);