File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ var Nav = React.createClass({
2121 collapsable : React . PropTypes . bool ,
2222 expanded : React . PropTypes . bool ,
2323 navbar : React . PropTypes . bool ,
24- eventKey : React . PropTypes . any
24+ eventKey : React . PropTypes . any ,
25+ right : React . PropTypes . bool
2526 } ,
2627
2728 getDefaultProps : function ( ) {
@@ -65,6 +66,7 @@ var Nav = React.createClass({
6566 classes [ 'nav-justified' ] = this . props . justified ;
6667 classes [ 'navbar-nav' ] = this . props . navbar ;
6768 classes [ 'pull-right' ] = this . props . pullRight ;
69+ classes [ 'navbar-right' ] = this . props . right ;
6870
6971 return (
7072 < ul { ...this . props } className = { joinClasses ( this . props . className , classSet ( classes ) ) } ref = "ul" >
Original file line number Diff line number Diff line change @@ -59,6 +59,16 @@ describe('Nav', function () {
5959 assert . ok ( ReactTestUtils . findRenderedDOMComponentWithClass ( instance , 'pull-right' ) ) ;
6060 } ) ;
6161
62+ it ( 'Should add navbar-right class' , function ( ) {
63+ var instance = ReactTestUtils . renderIntoDocument (
64+ < Nav bsStyle = "tabs" right activeKey = { 1 } >
65+ < NavItem key = { 1 } ref = "item1" > Tab 1 content</ NavItem >
66+ < NavItem key = { 2 } ref = "item2" > Tab 2 content</ NavItem >
67+ </ Nav >
68+ ) ;
69+ assert . ok ( ReactTestUtils . findRenderedDOMComponentWithClass ( instance , 'navbar-right' ) ) ;
70+ } ) ;
71+
6272 it ( 'Should call on select when item is selected' , function ( done ) {
6373 function handleSelect ( key ) {
6474 assert . equal ( key , '2' ) ;
You can’t perform that action at this time.
0 commit comments