Skip to content

Commit 6d36bc0

Browse files
committed
Merge branch 'master' into pr-308
2 parents 59fcc58 + 04797a7 commit 6d36bc0

20 files changed

Lines changed: 194 additions & 16 deletions

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# react-bootstrap
22

3+
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/react-bootstrap/react-bootstrap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4+
35
[Bootstrap 3](http://getbootstrap.com) components built with [React](http://facebook.github.io/react/)
46

57
[![Build Status](https://travis-ci.org/react-bootstrap/react-bootstrap.svg)](https://travis-ci.org/react-bootstrap/react-bootstrap) [![NPM version](https://badge.fury.io/js/react-bootstrap.svg)](http://badge.fury.io/js/react-bootstrap) [![Bower version](https://badge.fury.io/bo/react-bootstrap.svg)](http://badge.fury.io/bo/react-bootstrap)

docs/examples/ModalStatic.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var modalInstance = (
77
<Modal title="Modal title"
88
backdrop={false}
99
animation={false}
10+
container={mountNode}
1011
onRequestHide={handleHide}>
1112
<div className="modal-body">
1213
One fine body...

docs/src/GettingStartedPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var Page = React.createClass({
2525
<h2 id="setup" className="page-header">Setup</h2>
2626
<p className="lead">You can import the lib with as AMD modules, CommonJS modules as a global JS script.</p>
2727

28-
<p>First add the bootstrap CSS to your project then:</p>
28+
<p>First add the Bootstrap CSS to your project; check <a href="http://getbootstrap.com/getting-started/" name="Bootstrap Docs">here</a> if you have not already done that. Then:</p>
2929

3030
<h3>CommonJS</h3>
3131
<div className="highlight">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-bootstrap",
3-
"version": "0.13.0",
3+
"version": "0.13.2",
44
"description": "Bootstrap 3 components build with React",
55
"repository": {
66
"type": "git",

src/Button.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ var Button = React.createClass({
1212
block: React.PropTypes.bool,
1313
navItem: React.PropTypes.bool,
1414
navDropdown: React.PropTypes.bool,
15-
componentClass: React.PropTypes.node
15+
componentClass: React.PropTypes.node,
16+
href: React.PropTypes.string,
17+
target: React.PropTypes.string
1618
},
1719

1820
getDefaultProps: function () {
@@ -34,7 +36,7 @@ var Button = React.createClass({
3436
return this.renderNavItem(classes);
3537
}
3638

37-
renderFuncName = this.props.href || this.props.navDropdown ?
39+
renderFuncName = this.props.href || this.props.target || this.props.navDropdown ?
3840
'renderAnchor' : 'renderButton';
3941

4042
return this[renderFuncName](classes);

src/ListGroupItem.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ var ListGroupItem = React.createClass({
1515
disabled: React.PropTypes.any,
1616
header: React.PropTypes.node,
1717
onClick: React.PropTypes.func,
18-
eventKey: React.PropTypes.any
18+
eventKey: React.PropTypes.any,
19+
href: React.PropTypes.string,
20+
target: React.PropTypes.string
1921
},
2022

2123
getDefaultProps: function () {
@@ -30,7 +32,7 @@ var ListGroupItem = React.createClass({
3032
classes['active'] = this.props.active;
3133
classes['disabled'] = this.props.disabled;
3234

33-
if (this.props.href || this.props.onClick) {
35+
if (this.props.href || this.props.target || this.props.onClick) {
3436
return this.renderAnchor(classes);
3537
} else {
3638
return this.renderSpan(classes);
@@ -85,7 +87,7 @@ var ListGroupItem = React.createClass({
8587
handleClick: function (e) {
8688
if (this.props.onClick) {
8789
e.preventDefault();
88-
this.props.onClick(this.props.eventKey, this.props.href);
90+
this.props.onClick(this.props.eventKey, this.props.href, this.props.target);
8991
}
9092
}
9193
});

src/MenuItem.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ var MenuItem = React.createClass({
88
divider: React.PropTypes.bool,
99
href: React.PropTypes.string,
1010
title: React.PropTypes.string,
11+
target: React.PropTypes.string,
1112
onSelect: React.PropTypes.func,
12-
eventKey: React.PropTypes.any
13+
eventKey: React.PropTypes.any
1314
},
1415

1516
getDefaultProps: function () {
@@ -21,13 +22,13 @@ var MenuItem = React.createClass({
2122
handleClick: function (e) {
2223
if (this.props.onSelect) {
2324
e.preventDefault();
24-
this.props.onSelect(this.props.eventKey);
25+
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
2526
}
2627
},
2728

2829
renderAnchor: function () {
2930
return (
30-
<a onClick={this.handleClick} href={this.props.href} title={this.props.title} tabIndex="-1">
31+
<a onClick={this.handleClick} href={this.props.href} target={this.props.target} title={this.props.title} tabIndex="-1">
3132
{this.props.children}
3233
</a>
3334
);

src/Modal.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ var Modal = React.createClass({
124124
this._onDocumentKeyupListener =
125125
EventListener.listen(document, 'keyup', this.handleDocumentKeyUp);
126126

127+
var container = (this.props.container && this.props.container.getDOMNode()) || document.body;
128+
container.className += container.className.length ? ' modal-open' : 'modal-open';
129+
127130
if (this.props.backdrop) {
128131
this.iosClickHack();
129132
}
@@ -137,6 +140,8 @@ var Modal = React.createClass({
137140

138141
componentWillUnmount: function () {
139142
this._onDocumentKeyupListener.remove();
143+
var container = (this.props.container && this.props.container.getDOMNode()) || document.body;
144+
container.className = container.className.replace(/ ?modal-open/, '');
140145
},
141146

142147
handleBackdropClick: function (e) {

src/NavItem.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ var NavItem = React.createClass({
1212
disabled: React.PropTypes.bool,
1313
href: React.PropTypes.string,
1414
title: React.PropTypes.string,
15-
eventKey: React.PropTypes.any
15+
eventKey: React.PropTypes.any,
16+
target: React.PropTypes.string
1617
},
1718

1819
getDefaultProps: function () {
@@ -27,6 +28,7 @@ var NavItem = React.createClass({
2728
active,
2829
href,
2930
title,
31+
target,
3032
children,
3133
...props } = this.props,
3234
classes = {
@@ -39,6 +41,7 @@ var NavItem = React.createClass({
3941
<a
4042
href={href}
4143
title={title}
44+
target={target}
4245
onClick={this.handleClick}
4346
ref="anchor">
4447
{ children }
@@ -52,7 +55,7 @@ var NavItem = React.createClass({
5255
e.preventDefault();
5356

5457
if (!this.props.disabled) {
55-
this.props.onSelect(this.props.eventKey, this.props.href);
58+
this.props.onSelect(this.props.eventKey, this.props.href, this.props.target);
5659
}
5760
}
5861
}

src/OverlayTrigger.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ var OverlayTrigger = React.createClass({
118118
clearTimeout(this._hoverDelay);
119119
},
120120

121+
componentDidMount: function() {
122+
this.updateOverlayPosition();
123+
},
124+
121125
handleDelayedShow: function () {
122126
if (this._hoverDelay != null) {
123127
clearTimeout(this._hoverDelay);

0 commit comments

Comments
 (0)