File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -97,17 +97,14 @@ export default React.createClass({
9797 }
9898 } ,
9999
100- _getClassName ( name ) {
101- if ( arguments . length === 1 ) {
102- return this . props . classNames [ name ] || DEFAULT_CLASS_NAMES [ name ]
103- }
104-
105- for ( var i = 0 , l = arguments . length ; i < l ; i ++ ) {
106- if ( arguments [ i ] in this . props . classNames ) {
107- return this . props . classNames [ arguments [ i ] ]
100+ _getClassName ( name , ...modifiers ) {
101+ let classNames = [ this . props . classNames [ name ] || DEFAULT_CLASS_NAMES [ name ] ]
102+ for ( let i = 0 , l = modifiers . length ; i < l ; i ++ ) {
103+ if ( modifiers [ i ] ) {
104+ classNames . push ( this . props . classNames [ modifiers [ i ] ] || DEFAULT_CLASS_NAMES [ modifiers [ i ] ] )
108105 }
109106 }
110- return DEFAULT_CLASS_NAMES [ name ]
107+ return classNames . join ( ' ' )
111108 } ,
112109
113110 _filterOptions ( filter , selectedOptions , options ) {
@@ -213,7 +210,7 @@ export default React.createClass({
213210 } ) }
214211 </ select >
215212 < button type = "button"
216- className = { hasSelectedOptions ? this . _getClassName ( 'buttonActive ' , 'button' ) : this . _getClassName ( 'button ') }
213+ className = { this . _getClassName ( 'button ' , hasSelectedOptions && 'buttonActive ') }
217214 disabled = { ! hasSelectedOptions }
218215 onClick = { this . _addSelectedToSelection } >
219216 { this . props . buttonText }
You can’t perform that action at this time.
0 commit comments