@@ -56,10 +56,10 @@ var Panel = React.createClass({
56
56
57
57
render : function ( ) {
58
58
var classes = this . getBsClassSet ( ) ;
59
- classes [ 'panel' ] = true ;
60
59
61
60
return (
62
- < div { ...this . props } className = { joinClasses ( this . props . className , classSet ( classes ) ) }
61
+ < div { ...this . props }
62
+ className = { joinClasses ( this . props . className , classSet ( classes ) ) }
63
63
id = { this . props . collapsable ? null : this . props . id } onSelect = { null } >
64
64
{ this . renderHeading ( ) }
65
65
{ this . props . collapsable ? this . renderCollapsableBody ( ) : this . renderBody ( ) }
@@ -69,11 +69,13 @@ var Panel = React.createClass({
69
69
} ,
70
70
71
71
renderCollapsableBody : function ( ) {
72
+ var collapseClass = this . prefixClass ( 'collapse' ) ;
73
+
72
74
return (
73
75
< div
74
- className = { classSet ( this . getCollapsableClassSet ( 'panel-collapse' ) ) }
76
+ className = { classSet ( this . getCollapsableClassSet ( collapseClass ) ) }
75
77
id = { this . props . id }
76
- ref = " panel"
78
+ ref = ' panel'
77
79
aria-expanded = { this . isExpanded ( ) ? 'true' : 'false' } >
78
80
{ this . renderBody ( ) }
79
81
</ div >
@@ -84,6 +86,7 @@ var Panel = React.createClass({
84
86
var allChildren = this . props . children ;
85
87
var bodyElements = [ ] ;
86
88
var panelBodyChildren = [ ] ;
89
+ var bodyClass = this . prefixClass ( 'body' ) ;
87
90
88
91
function getProps ( ) {
89
92
return { key : bodyElements . length } ;
@@ -95,7 +98,7 @@ var Panel = React.createClass({
95
98
96
99
function addPanelBody ( children ) {
97
100
bodyElements . push (
98
- < div className = "panel-body" { ...getProps ( ) } >
101
+ < div className = { bodyClass } { ...getProps ( ) } >
99
102
{ children }
100
103
</ div >
101
104
) ;
@@ -152,17 +155,17 @@ var Panel = React.createClass({
152
155
this . renderCollapsableTitle ( header ) : header ;
153
156
} else if ( this . props . collapsable ) {
154
157
header = cloneWithProps ( header , {
155
- className : 'panel- title',
158
+ className : this . prefixClass ( ' title') ,
156
159
children : this . renderAnchor ( header . props . children )
157
160
} ) ;
158
161
} else {
159
162
header = cloneWithProps ( header , {
160
- className : 'panel- title'
163
+ className : this . prefixClass ( ' title')
161
164
} ) ;
162
165
}
163
166
164
167
return (
165
- < div className = "panel- heading" >
168
+ < div className = { this . prefixClass ( ' heading' ) } >
166
169
{ header }
167
170
</ div >
168
171
) ;
@@ -182,7 +185,7 @@ var Panel = React.createClass({
182
185
183
186
renderCollapsableTitle : function ( header ) {
184
187
return (
185
- < h4 className = "panel- title" >
188
+ < h4 className = { this . prefixClass ( ' title' ) } >
186
189
{ this . renderAnchor ( header ) }
187
190
</ h4 >
188
191
) ;
@@ -194,7 +197,7 @@ var Panel = React.createClass({
194
197
}
195
198
196
199
return (
197
- < div className = "panel- footer" >
200
+ < div className = { this . prefixClass ( ' footer' ) } >
198
201
{ this . props . footer }
199
202
</ div >
200
203
) ;
0 commit comments