dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b73c12c
)
Follow-up r73270. Moving the attribute check down to the point where it's for sure...
author
Krinkle
<krinkle@users.mediawiki.org>
Mon, 21 Feb 2011 20:36:07 +0000
(20:36 +0000)
committer
Krinkle
<krinkle@users.mediawiki.org>
Mon, 21 Feb 2011 20:36:07 +0000
(20:36 +0000)
skins/common/wikibits.js
patch
|
blob
|
history
diff --git
a/skins/common/wikibits.js
b/skins/common/wikibits.js
index
c70556e
..
b862f5c
100644
(file)
--- a/
skins/common/wikibits.js
+++ b/
skins/common/wikibits.js
@@
-332,16
+332,18
@@
window.addPortletLink = function( portlet, href, text, id, tooltip, accesskey, n
};
window.getInnerText = function( el ) {
};
window.getInnerText = function( el ) {
- if ( el.getAttribute( 'data-sort-value' ) !== null ) {
- return el.getAttribute( 'data-sort-value' );
- }
-
if ( typeof el == 'string' ) {
return el;
}
if ( typeof el == 'undefined' ) {
return el;
}
if ( typeof el == 'string' ) {
return el;
}
if ( typeof el == 'undefined' ) {
return el;
}
+ // Custom sort value through 'data-sort-value' attribute
+ // (no need to prepend hidden text to change sort value)
+ if ( el.nodeType && el.getAttribute( 'data-sort-value' ) !== null ) {
+ // Make sure it's a valid DOM element (.nodeType) and that the attribute is set (!null)
+ return el.getAttribute( 'data-sort-value' );
+ }
if ( el.textContent ) {
return el.textContent; // not needed but it is faster
}
if ( el.textContent ) {
return el.textContent; // not needed but it is faster
}