Fixed bug #178
This commit is contained in:
parent
43d3deb7c8
commit
1293e80ff9
1 changed files with 11 additions and 9 deletions
16
src/jquery/jquery.js
vendored
16
src/jquery/jquery.js
vendored
|
@ -1917,14 +1917,16 @@ jQuery.extend({
|
||||||
sibling: function(elem, pos, not) {
|
sibling: function(elem, pos, not) {
|
||||||
var elems = [];
|
var elems = [];
|
||||||
|
|
||||||
var siblings = elem.parentNode.childNodes;
|
if(elem) {
|
||||||
for ( var i = 0; i < siblings.length; i++ ) {
|
var siblings = elem.parentNode.childNodes;
|
||||||
if ( not === true && siblings[i] == elem ) continue;
|
for ( var i = 0; i < siblings.length; i++ ) {
|
||||||
|
if ( not === true && siblings[i] == elem ) continue;
|
||||||
|
|
||||||
if ( siblings[i].nodeType == 1 )
|
if ( siblings[i].nodeType == 1 )
|
||||||
elems.push( siblings[i] );
|
elems.push( siblings[i] );
|
||||||
if ( siblings[i] == elem )
|
if ( siblings[i] == elem )
|
||||||
elems.n = elems.length - 1;
|
elems.n = elems.length - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return jQuery.extend( elems, {
|
return jQuery.extend( elems, {
|
||||||
|
|
Loading…
Reference in a new issue