react-bootstrap
Advanced tools
Comparing version 0.20.1 to 0.20.2
{ | ||
"name": "react-bootstrap", | ||
"version": "0.20.1", | ||
"version": "0.20.2", | ||
"homepage": "http://react-bootstrap.github.io/", | ||
@@ -5,0 +5,0 @@ "author": "Stephen J. Collings <stevoland@gmail.com>", |
@@ -116,3 +116,3 @@ define(["exports", "module", "react", "./utils/domUtils", "./utils/EventListener"], function (exports, module, _react, _utilsDomUtils, _utilsEventListener) { | ||
this._onWindowScrollListener = EventListener.listen(window, "scroll", this.checkPosition); | ||
this._onDocumentClickListener = EventListener.listen(React.findDOMNode(this).ownerDocument, "click", this.checkPositionWithEventLoop); | ||
this._onDocumentClickListener = EventListener.listen(domUtils.ownerDocument(this), "click", this.checkPositionWithEventLoop); | ||
}, | ||
@@ -119,0 +119,0 @@ |
@@ -29,2 +29,4 @@ define(["exports", "module", "react", "./BootstrapMixin", "./CollapsableMixin", "classnames", "./utils/domUtils", "./utils/ValidComponentChildren", "./utils/createChainedFunction"], function (exports, module, _react, _BootstrapMixin, _CollapsableMixin, _classnames, _utilsDomUtils, _utilsValidComponentChildren, _utilsCreateChainedFunction) { | ||
onSelect: React.PropTypes.func, | ||
activeHref: React.PropTypes.string, | ||
activeKey: React.PropTypes.any, | ||
expanded: React.PropTypes.bool, | ||
@@ -31,0 +33,0 @@ eventKey: React.PropTypes.any |
@@ -1,2 +0,2 @@ | ||
define(["exports", "module", "react", "./utils/EventListener"], function (exports, module, _react, _utilsEventListener) { | ||
define(["exports", "module", "react", "./utils/domUtils", "./utils/EventListener"], function (exports, module, _react, _utilsDomUtils, _utilsEventListener) { | ||
"use strict"; | ||
@@ -8,2 +8,4 @@ | ||
var domUtils = _interopRequire(_utilsDomUtils); | ||
var EventListener = _interopRequire(_utilsEventListener); | ||
@@ -66,3 +68,3 @@ | ||
bindRootCloseHandlers: function bindRootCloseHandlers() { | ||
var doc = React.findDOMNode(this).ownerDocument; | ||
var doc = domUtils.ownerDocument(this); | ||
@@ -69,0 +71,0 @@ this._onDocumentClickListener = EventListener.listen(doc, "click", this.handleDocumentClick); |
@@ -1,2 +0,2 @@ | ||
define(["exports", "module", "react"], function (exports, module, _react) { | ||
define(["exports", "module", "react", "./utils/domUtils"], function (exports, module, _react, _utilsDomUtils) { | ||
"use strict"; | ||
@@ -8,2 +8,4 @@ | ||
var domUtils = _interopRequire(_utilsDomUtils); | ||
// TODO: listen for onTransitionEnd to remove el | ||
@@ -68,3 +70,3 @@ function getElementsAndSelf(root, classes) { | ||
var els = getElementsAndSelf(React.findDOMNode(this), ["fade"]), | ||
container = this.props.container && React.findDOMNode(this.props.container) || React.findDOMNode(this).ownerDocument.body; | ||
container = this.props.container && React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; | ||
@@ -71,0 +73,0 @@ if (els.length) { |
@@ -38,2 +38,3 @@ define(["exports", "module", "react", "classnames", "./Button", "./FormGroup"], function (exports, module, _react, _classnames, _Button, _FormGroup) { | ||
hasFeedback: React.PropTypes.bool, | ||
id: React.PropTypes.string, | ||
groupClassName: React.PropTypes.string, | ||
@@ -40,0 +41,0 @@ wrapperClassName: React.PropTypes.string, |
@@ -1,2 +0,2 @@ | ||
define(["exports", "module", "react", "classnames", "./BootstrapMixin", "./FadeMixin", "./utils/EventListener"], function (exports, module, _react, _classnames, _BootstrapMixin, _FadeMixin, _utilsEventListener) { | ||
define(["exports", "module", "react", "classnames", "./BootstrapMixin", "./FadeMixin", "./utils/domUtils", "./utils/EventListener"], function (exports, module, _react, _classnames, _BootstrapMixin, _FadeMixin, _utilsDomUtils, _utilsEventListener) { | ||
"use strict"; | ||
@@ -16,2 +16,4 @@ | ||
var domUtils = _interopRequire(_utilsDomUtils); | ||
var EventListener = _interopRequire(_utilsEventListener); | ||
@@ -147,5 +149,5 @@ | ||
componentDidMount: function componentDidMount() { | ||
this._onDocumentKeyupListener = EventListener.listen(React.findDOMNode(this).ownerDocument, "keyup", this.handleDocumentKeyUp); | ||
this._onDocumentKeyupListener = EventListener.listen(domUtils.ownerDocument(this), "keyup", this.handleDocumentKeyUp); | ||
var container = this.props.container && React.findDOMNode(this.props.container) || React.findDOMNode(this).ownerDocument.body; | ||
var container = this.props.container && React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; | ||
container.className += container.className.length ? " modal-open" : "modal-open"; | ||
@@ -166,3 +168,3 @@ | ||
this._onDocumentKeyupListener.remove(); | ||
var container = this.props.container && React.findDOMNode(this.props.container) || React.findDOMNode(this).ownerDocument.body; | ||
var container = this.props.container && React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; | ||
container.className = container.className.replace(/ ?modal-open/, ""); | ||
@@ -169,0 +171,0 @@ }, |
@@ -30,2 +30,4 @@ define(["exports", "module", "react", "./BootstrapMixin", "./CollapsableMixin", "classnames", "./utils/domUtils", "./utils/ValidComponentChildren", "./utils/createChainedFunction"], function (exports, module, _react, _BootstrapMixin, _CollapsableMixin, _classnames, _utilsDomUtils, _utilsValidComponentChildren, _utilsCreateChainedFunction) { | ||
propTypes: { | ||
activeHref: React.PropTypes.string, | ||
activeKey: React.PropTypes.any, | ||
bsStyle: React.PropTypes.oneOf(["tabs", "pills"]), | ||
@@ -32,0 +34,0 @@ stacked: React.PropTypes.bool, |
@@ -1,2 +0,2 @@ | ||
define(["exports", "module", "react", "./utils/CustomPropTypes"], function (exports, module, _react, _utilsCustomPropTypes) { | ||
define(["exports", "module", "react", "./utils/CustomPropTypes", "./utils/domUtils"], function (exports, module, _react, _utilsCustomPropTypes, _utilsDomUtils) { | ||
"use strict"; | ||
@@ -10,2 +10,4 @@ | ||
var domUtils = _interopRequire(_utilsDomUtils); | ||
module.exports = { | ||
@@ -71,5 +73,5 @@ propTypes: { | ||
getContainerDOMNode: function getContainerDOMNode() { | ||
return React.findDOMNode(this.props.container || React.findDOMNode(this).ownerDocument.body); | ||
return React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; | ||
} | ||
}; | ||
}); |
@@ -27,2 +27,3 @@ define(["exports", "module", "react", "classnames", "./BootstrapMixin", "./CollapsableMixin"], function (exports, module, _react, _classnames, _BootstrapMixin, _CollapsableMixin) { | ||
header: React.PropTypes.node, | ||
id: React.PropTypes.string, | ||
footer: React.PropTypes.node, | ||
@@ -29,0 +30,0 @@ eventKey: React.PropTypes.any |
@@ -31,2 +31,3 @@ define(["exports", "module", "react", "classnames", "./BootstrapMixin", "./DropdownStateMixin", "./Button", "./ButtonGroup", "./DropdownMenu"], function (exports, module, _react, _classnames, _BootstrapMixin, _DropdownStateMixin, _Button, _ButtonGroup, _DropdownMenu) { | ||
href: React.PropTypes.string, | ||
id: React.PropTypes.string, | ||
target: React.PropTypes.string, | ||
@@ -33,0 +34,0 @@ dropdownTitle: React.PropTypes.node, |
@@ -28,2 +28,4 @@ define(["exports", "module", "react", "classnames", "./utils/ValidComponentChildren", "./utils/createChainedFunction", "./BootstrapMixin"], function (exports, module, _react, _classnames, _utilsValidComponentChildren, _utilsCreateChainedFunction, _BootstrapMixin) { | ||
active: React.PropTypes.bool, | ||
activeHref: React.PropTypes.string, | ||
activeKey: React.PropTypes.any, | ||
disabled: React.PropTypes.bool, | ||
@@ -30,0 +32,0 @@ href: React.PropTypes.string, |
@@ -38,4 +38,7 @@ define(["exports", "module", "react", "./BootstrapMixin", "./utils/ValidComponentChildren", "./Nav", "./NavItem"], function (exports, module, _react, _BootstrapMixin, _utilsValidComponentChildren, _Nav, _NavItem) { | ||
propTypes: { | ||
activeKey: React.PropTypes.any, | ||
defaultActiveKey: React.PropTypes.any, | ||
bsStyle: React.PropTypes.oneOf(["tabs", "pills"]), | ||
animation: React.PropTypes.bool, | ||
id: React.PropTypes.string, | ||
onSelect: React.PropTypes.func | ||
@@ -42,0 +45,0 @@ }, |
@@ -17,2 +17,6 @@ define(["exports", "module", "react", "classnames", "./utils/TransitionEvents"], function (exports, module, _react, _classnames, _utilsTransitionEvents) { | ||
propTypes: { | ||
active: React.PropTypes.bool | ||
}, | ||
getDefaultProps: function getDefaultProps() { | ||
@@ -19,0 +23,0 @@ return { |
@@ -1,3 +0,20 @@ | ||
define(["exports", "module"], function (exports, module) { | ||
define(["exports", "module", "react"], function (exports, module, _react) { | ||
"use strict"; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; | ||
var React = _interopRequire(_react); | ||
/** | ||
* Get elements owner document | ||
* | ||
* @param {ReactComponent|HTMLElement} componentOrElement | ||
* @returns {HTMLElement} | ||
*/ | ||
function ownerDocument(componentOrElement) { | ||
var elem = React.findDOMNode(componentOrElement); | ||
return elem && elem.ownerDocument || document; | ||
} | ||
/** | ||
* Shortcut to compute element style | ||
@@ -8,6 +25,4 @@ * | ||
*/ | ||
"use strict"; | ||
function getComputedStyles(elem) { | ||
return elem.ownerDocument.defaultView.getComputedStyle(elem, null); | ||
return ownerDocument(elem).defaultView.getComputedStyle(elem, null); | ||
} | ||
@@ -28,3 +43,3 @@ | ||
var docElem = DOMNode.ownerDocument.documentElement; | ||
var docElem = ownerDocument(DOMNode).documentElement; | ||
var box = { top: 0, left: 0 }; | ||
@@ -96,3 +111,3 @@ | ||
function offsetParentFunc(elem) { | ||
var docElem = elem.ownerDocument.documentElement; | ||
var docElem = ownerDocument(elem).documentElement; | ||
var offsetParent = elem.offsetParent || docElem; | ||
@@ -108,2 +123,3 @@ | ||
module.exports = { | ||
ownerDocument: ownerDocument, | ||
getComputedStyles: getComputedStyles, | ||
@@ -110,0 +126,0 @@ getOffset: getOffset, |
@@ -0,1 +1,11 @@ | ||
v0.20.2 - Tue, 07 Apr 2015 01:51:55 GMT | ||
--------------------------------------- | ||
- [723ee4d](../../commit/723ee4d) [fixed] Release scripts usage of rimraf | ||
- [7175431](../../commit/7175431) [fixed] Don't try to access .ownerDocument on null | ||
- [a58cff9](../../commit/a58cff9) [fixed] Numerous ESlint warnings (Removes 145 warnings) | ||
- [c6c4108](../../commit/c6c4108) [added] Twitter follow link to docs page footer | ||
- [20472b9](../../commit/20472b9) [fixed] Windows build | ||
v0.20.1 - Sat, 04 Apr 2015 14:22:18 GMT | ||
@@ -2,0 +12,0 @@ --------------------------------------- |
@@ -115,3 +115,3 @@ "use strict"; | ||
this._onWindowScrollListener = EventListener.listen(window, "scroll", this.checkPosition); | ||
this._onDocumentClickListener = EventListener.listen(React.findDOMNode(this).ownerDocument, "click", this.checkPositionWithEventLoop); | ||
this._onDocumentClickListener = EventListener.listen(domUtils.ownerDocument(this), "click", this.checkPositionWithEventLoop); | ||
}, | ||
@@ -118,0 +118,0 @@ |
@@ -30,2 +30,4 @@ "use strict"; | ||
onSelect: React.PropTypes.func, | ||
activeHref: React.PropTypes.string, | ||
activeKey: React.PropTypes.any, | ||
expanded: React.PropTypes.bool, | ||
@@ -32,0 +34,0 @@ eventKey: React.PropTypes.any |
@@ -7,2 +7,4 @@ "use strict"; | ||
var domUtils = _interopRequire(require("./utils/domUtils")); | ||
var EventListener = _interopRequire(require("./utils/EventListener")); | ||
@@ -65,3 +67,3 @@ | ||
bindRootCloseHandlers: function bindRootCloseHandlers() { | ||
var doc = React.findDOMNode(this).ownerDocument; | ||
var doc = domUtils.ownerDocument(this); | ||
@@ -68,0 +70,0 @@ this._onDocumentClickListener = EventListener.listen(doc, "click", this.handleDocumentClick); |
@@ -7,2 +7,4 @@ "use strict"; | ||
var domUtils = _interopRequire(require("./utils/domUtils")); | ||
// TODO: listen for onTransitionEnd to remove el | ||
@@ -67,3 +69,3 @@ function getElementsAndSelf(root, classes) { | ||
var els = getElementsAndSelf(React.findDOMNode(this), ["fade"]), | ||
container = this.props.container && React.findDOMNode(this.props.container) || React.findDOMNode(this).ownerDocument.body; | ||
container = this.props.container && React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; | ||
@@ -70,0 +72,0 @@ if (els.length) { |
@@ -37,2 +37,3 @@ "use strict"; | ||
hasFeedback: React.PropTypes.bool, | ||
id: React.PropTypes.string, | ||
groupClassName: React.PropTypes.string, | ||
@@ -39,0 +40,0 @@ wrapperClassName: React.PropTypes.string, |
@@ -15,2 +15,4 @@ "use strict"; | ||
var domUtils = _interopRequire(require("./utils/domUtils")); | ||
var EventListener = _interopRequire(require("./utils/EventListener")); | ||
@@ -146,5 +148,5 @@ | ||
componentDidMount: function componentDidMount() { | ||
this._onDocumentKeyupListener = EventListener.listen(React.findDOMNode(this).ownerDocument, "keyup", this.handleDocumentKeyUp); | ||
this._onDocumentKeyupListener = EventListener.listen(domUtils.ownerDocument(this), "keyup", this.handleDocumentKeyUp); | ||
var container = this.props.container && React.findDOMNode(this.props.container) || React.findDOMNode(this).ownerDocument.body; | ||
var container = this.props.container && React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; | ||
container.className += container.className.length ? " modal-open" : "modal-open"; | ||
@@ -165,3 +167,3 @@ | ||
this._onDocumentKeyupListener.remove(); | ||
var container = this.props.container && React.findDOMNode(this.props.container) || React.findDOMNode(this).ownerDocument.body; | ||
var container = this.props.container && React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; | ||
container.className = container.className.replace(/ ?modal-open/, ""); | ||
@@ -168,0 +170,0 @@ }, |
@@ -31,2 +31,4 @@ "use strict"; | ||
propTypes: { | ||
activeHref: React.PropTypes.string, | ||
activeKey: React.PropTypes.any, | ||
bsStyle: React.PropTypes.oneOf(["tabs", "pills"]), | ||
@@ -33,0 +35,0 @@ stacked: React.PropTypes.bool, |
@@ -9,2 +9,4 @@ "use strict"; | ||
var domUtils = _interopRequire(require("./utils/domUtils")); | ||
module.exports = { | ||
@@ -70,4 +72,4 @@ propTypes: { | ||
getContainerDOMNode: function getContainerDOMNode() { | ||
return React.findDOMNode(this.props.container || React.findDOMNode(this).ownerDocument.body); | ||
return React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; | ||
} | ||
}; |
@@ -28,2 +28,3 @@ "use strict"; | ||
header: React.PropTypes.node, | ||
id: React.PropTypes.string, | ||
footer: React.PropTypes.node, | ||
@@ -30,0 +31,0 @@ eventKey: React.PropTypes.any |
@@ -30,2 +30,3 @@ "use strict"; | ||
href: React.PropTypes.string, | ||
id: React.PropTypes.string, | ||
target: React.PropTypes.string, | ||
@@ -32,0 +33,0 @@ dropdownTitle: React.PropTypes.node, |
@@ -29,2 +29,4 @@ "use strict"; | ||
active: React.PropTypes.bool, | ||
activeHref: React.PropTypes.string, | ||
activeKey: React.PropTypes.any, | ||
disabled: React.PropTypes.bool, | ||
@@ -31,0 +33,0 @@ href: React.PropTypes.string, |
@@ -39,4 +39,7 @@ "use strict"; | ||
propTypes: { | ||
activeKey: React.PropTypes.any, | ||
defaultActiveKey: React.PropTypes.any, | ||
bsStyle: React.PropTypes.oneOf(["tabs", "pills"]), | ||
animation: React.PropTypes.bool, | ||
id: React.PropTypes.string, | ||
onSelect: React.PropTypes.func | ||
@@ -43,0 +46,0 @@ }, |
@@ -16,2 +16,6 @@ "use strict"; | ||
propTypes: { | ||
active: React.PropTypes.bool | ||
}, | ||
getDefaultProps: function getDefaultProps() { | ||
@@ -18,0 +22,0 @@ return { |
@@ -0,2 +1,19 @@ | ||
"use strict"; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; | ||
var React = _interopRequire(require("react")); | ||
/** | ||
* Get elements owner document | ||
* | ||
* @param {ReactComponent|HTMLElement} componentOrElement | ||
* @returns {HTMLElement} | ||
*/ | ||
function ownerDocument(componentOrElement) { | ||
var elem = React.findDOMNode(componentOrElement); | ||
return elem && elem.ownerDocument || document; | ||
} | ||
/** | ||
* Shortcut to compute element style | ||
@@ -7,6 +24,4 @@ * | ||
*/ | ||
"use strict"; | ||
function getComputedStyles(elem) { | ||
return elem.ownerDocument.defaultView.getComputedStyle(elem, null); | ||
return ownerDocument(elem).defaultView.getComputedStyle(elem, null); | ||
} | ||
@@ -27,3 +42,3 @@ | ||
var docElem = DOMNode.ownerDocument.documentElement; | ||
var docElem = ownerDocument(DOMNode).documentElement; | ||
var box = { top: 0, left: 0 }; | ||
@@ -95,3 +110,3 @@ | ||
function offsetParentFunc(elem) { | ||
var docElem = elem.ownerDocument.documentElement; | ||
var docElem = ownerDocument(elem).documentElement; | ||
var offsetParent = elem.offsetParent || docElem; | ||
@@ -107,2 +122,3 @@ | ||
module.exports = { | ||
ownerDocument: ownerDocument, | ||
getComputedStyles: getComputedStyles, | ||
@@ -109,0 +125,0 @@ getOffset: getOffset, |
{ | ||
"name": "react-bootstrap", | ||
"version": "0.20.1", | ||
"version": "0.20.2", | ||
"description": "Bootstrap 3 components build with React", | ||
@@ -11,10 +11,10 @@ "repository": { | ||
"scripts": { | ||
"build": "./run-babel tools/build.js", | ||
"build": "node run-babel tools/build.js", | ||
"test-watch": "karma start", | ||
"test": "karma start --single-run && npm run lint && npm run build", | ||
"lint": "eslint src test docs ie8 tools webpack karma.conf.js webpack.config.js webpack.docs.js", | ||
"docs-build": "./run-babel tools/build.js --docs-only", | ||
"docs": "./run-babel docs/server.js", | ||
"docs-prod": "webpack --config webpack.docs.js -p --progress && NODE_ENV=production ./run-babel docs/server.js", | ||
"ie8": "./run-babel ie8/server.js" | ||
"docs-build": "node run-babel tools/build.js --docs-only", | ||
"docs": "node run-babel docs/server.js", | ||
"docs-prod": "webpack --config webpack.docs.js -p --progress && NODE_ENV=production node run-babel docs/server.js", | ||
"ie8": "node run-babel ie8/server.js" | ||
}, | ||
@@ -55,2 +55,3 @@ "main": "lib/index.js", | ||
"file-loader": "^0.8.1", | ||
"fs-extra": "^0.18.0", | ||
"fs-promise": "^0.3.1", | ||
@@ -76,2 +77,3 @@ "json-loader": "^0.5.1", | ||
"rf-changelog": "^0.4.0", | ||
"rimraf": "^2.3.2", | ||
"semver": "^4.3.1", | ||
@@ -78,0 +80,0 @@ "sinon": "^1.10.3", |
@@ -5,3 +5,3 @@ # react-bootstrap | ||
[![Build Status][build-badge]][build] | ||
[![Travis Build Status][build-badge]][build] | ||
[![NPM version][npm-badge]][npm] | ||
@@ -78,1 +78,4 @@ [![Bower version][bower-badge]][bower] | ||
[huboard]: https://huboard.com/react-bootstrap/react-bootstrap | ||
[appveyor-badge]: https://ci.appveyor.com/api/projects/status/ylitpyo6n5yq1s6i/branch/master?svg=true | ||
[appveyor]: https://ci.appveyor.com/project/mtscout6/react-bootstrap/branch/master |
@@ -107,3 +107,3 @@ import React from 'react'; | ||
this._onDocumentClickListener = | ||
EventListener.listen(React.findDOMNode(this).ownerDocument, 'click', this.checkPositionWithEventLoop); | ||
EventListener.listen(domUtils.ownerDocument(this), 'click', this.checkPositionWithEventLoop); | ||
}, | ||
@@ -110,0 +110,0 @@ |
@@ -15,2 +15,4 @@ import React, { cloneElement } from 'react'; | ||
onSelect: React.PropTypes.func, | ||
activeHref: React.PropTypes.string, | ||
activeKey: React.PropTypes.any, | ||
expanded: React.PropTypes.bool, | ||
@@ -17,0 +19,0 @@ eventKey: React.PropTypes.any |
import React from 'react'; | ||
import domUtils from './utils/domUtils'; | ||
import EventListener from './utils/EventListener'; | ||
@@ -59,3 +60,3 @@ | ||
bindRootCloseHandlers() { | ||
let doc = React.findDOMNode(this).ownerDocument; | ||
let doc = domUtils.ownerDocument(this); | ||
@@ -62,0 +63,0 @@ this._onDocumentClickListener = |
import React from 'react'; | ||
import domUtils from './utils/domUtils'; | ||
@@ -60,3 +61,4 @@ // TODO: listen for onTransitionEnd to remove el | ||
let els = getElementsAndSelf(React.findDOMNode(this), ['fade']), | ||
container = (this.props.container && React.findDOMNode(this.props.container)) || React.findDOMNode(this).ownerDocument.body; | ||
container = (this.props.container && React.findDOMNode(this.props.container)) || | ||
domUtils.ownerDocument(this).body; | ||
@@ -63,0 +65,0 @@ if (els.length) { |
@@ -27,2 +27,3 @@ import React from 'react'; | ||
hasFeedback: React.PropTypes.bool, | ||
id: React.PropTypes.string, | ||
groupClassName: React.PropTypes.string, | ||
@@ -29,0 +30,0 @@ wrapperClassName: React.PropTypes.string, |
@@ -5,2 +5,3 @@ import React from 'react'; | ||
import FadeMixin from './FadeMixin'; | ||
import domUtils from './utils/domUtils'; | ||
import EventListener from './utils/EventListener'; | ||
@@ -132,5 +133,6 @@ | ||
this._onDocumentKeyupListener = | ||
EventListener.listen(React.findDOMNode(this).ownerDocument, 'keyup', this.handleDocumentKeyUp); | ||
EventListener.listen(domUtils.ownerDocument(this), 'keyup', this.handleDocumentKeyUp); | ||
let container = (this.props.container && React.findDOMNode(this.props.container)) || React.findDOMNode(this).ownerDocument.body; | ||
let container = (this.props.container && React.findDOMNode(this.props.container)) || | ||
domUtils.ownerDocument(this).body; | ||
container.className += container.className.length ? ' modal-open' : 'modal-open'; | ||
@@ -151,3 +153,4 @@ | ||
this._onDocumentKeyupListener.remove(); | ||
let container = (this.props.container && React.findDOMNode(this.props.container)) || React.findDOMNode(this).ownerDocument.body; | ||
let container = (this.props.container && React.findDOMNode(this.props.container)) || | ||
domUtils.ownerDocument(this).body; | ||
container.className = container.className.replace(/ ?modal-open/, ''); | ||
@@ -154,0 +157,0 @@ }, |
@@ -15,2 +15,4 @@ import React, { cloneElement } from 'react'; | ||
propTypes: { | ||
activeHref: React.PropTypes.string, | ||
activeKey: React.PropTypes.any, | ||
bsStyle: React.PropTypes.oneOf(['tabs', 'pills']), | ||
@@ -17,0 +19,0 @@ stacked: React.PropTypes.bool, |
import React from 'react'; | ||
import CustomPropTypes from './utils/CustomPropTypes'; | ||
import domUtils from './utils/domUtils'; | ||
@@ -66,4 +67,4 @@ export default { | ||
getContainerDOMNode() { | ||
return React.findDOMNode(this.props.container || React.findDOMNode(this).ownerDocument.body); | ||
return React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body; | ||
} | ||
}; |
@@ -14,2 +14,3 @@ import React, { cloneElement } from 'react'; | ||
header: React.PropTypes.node, | ||
id: React.PropTypes.string, | ||
footer: React.PropTypes.node, | ||
@@ -16,0 +17,0 @@ eventKey: React.PropTypes.any |
@@ -16,2 +16,3 @@ import React from 'react'; | ||
href: React.PropTypes.string, | ||
id: React.PropTypes.string, | ||
target: React.PropTypes.string, | ||
@@ -18,0 +19,0 @@ dropdownTitle: React.PropTypes.node, |
@@ -14,2 +14,4 @@ import React, { cloneElement } from 'react'; | ||
active: React.PropTypes.bool, | ||
activeHref: React.PropTypes.string, | ||
activeKey: React.PropTypes.any, | ||
disabled: React.PropTypes.bool, | ||
@@ -16,0 +18,0 @@ href: React.PropTypes.string, |
@@ -24,4 +24,7 @@ import React, { cloneElement } from 'react'; | ||
propTypes: { | ||
bsStyle: React.PropTypes.oneOf(['tabs','pills']), | ||
activeKey: React.PropTypes.any, | ||
defaultActiveKey: React.PropTypes.any, | ||
bsStyle: React.PropTypes.oneOf(['tabs', 'pills']), | ||
animation: React.PropTypes.bool, | ||
id: React.PropTypes.string, | ||
onSelect: React.PropTypes.func | ||
@@ -28,0 +31,0 @@ }, |
@@ -6,2 +6,6 @@ import React from 'react'; | ||
const TabPane = React.createClass({ | ||
propTypes: { | ||
active: React.PropTypes.bool | ||
}, | ||
getDefaultProps() { | ||
@@ -8,0 +12,0 @@ return { |
@@ -0,2 +1,15 @@ | ||
import React from 'react'; | ||
/** | ||
* Get elements owner document | ||
* | ||
* @param {ReactComponent|HTMLElement} componentOrElement | ||
* @returns {HTMLElement} | ||
*/ | ||
function ownerDocument(componentOrElement) { | ||
let elem = React.findDOMNode(componentOrElement); | ||
return (elem && elem.ownerDocument) || document; | ||
} | ||
/** | ||
* Shortcut to compute element style | ||
@@ -8,3 +21,3 @@ * | ||
function getComputedStyles(elem) { | ||
return elem.ownerDocument.defaultView.getComputedStyle(elem, null); | ||
return ownerDocument(elem).defaultView.getComputedStyle(elem, null); | ||
} | ||
@@ -25,3 +38,3 @@ | ||
let docElem = DOMNode.ownerDocument.documentElement; | ||
let docElem = ownerDocument(DOMNode).documentElement; | ||
let box = { top: 0, left: 0 }; | ||
@@ -94,3 +107,3 @@ | ||
function offsetParentFunc(elem) { | ||
let docElem = elem.ownerDocument.documentElement; | ||
let docElem = ownerDocument(elem).documentElement; | ||
let offsetParent = elem.offsetParent || docElem; | ||
@@ -107,2 +120,3 @@ | ||
export default { | ||
ownerDocument: ownerDocument, | ||
getComputedStyles: getComputedStyles, | ||
@@ -109,0 +123,0 @@ getOffset: getOffset, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1002955
214
22991
80
47