aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-01-13 16:36:14 -0500
committerScott González <scott.gonzalez@gmail.com>2011-01-13 16:38:07 -0500
commita7aa65d1fcbb21f6591985d05e147daa23df60d5 (patch)
treeeb7865bb456ed69f8e77629d6e8d0902becb2216
parent13ca4847f1eec2f051884354487a380c264370bb (diff)
downloadjquery-ui-a7aa65d1fcbb21f6591985d05e147daa23df60d5.tar.gz
jquery-ui-a7aa65d1fcbb21f6591985d05e147daa23df60d5.zip
Accordion - Make sure we have an element before trying to modify the className. Fixes #6856 - Accordion: Opening a panel after all panels have been collapsed causes an error.
-rw-r--r--ui/jquery.ui.accordion.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index 580fda3ed..b6970f5eb 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -504,7 +504,9 @@ $.widget( "ui.accordion", {
// other classes are removed before the animation; this one needs to stay until completed
this.toHide.removeClass( "ui-accordion-content-active" );
// Work around for rendering bug in IE (#5421)
- this.toHide.parent()[0].className = this.toHide.parent()[0].className;
+ if ( this.toHide.length ) {
+ this.toHide.parent()[0].className = this.toHide.parent()[0].className;
+ }
this._trigger( "change", null, this.data );
}