Skip to content

Commit

Permalink
Merge tag 'v0.23.3' into v0.24-rc
Browse files Browse the repository at this point in the history
v0.23.3

Conflicts:
	package.json
  • Loading branch information
mtscout6 committed Jun 12, 2015
2 parents 56fe42c + beb5142 commit 4b1e116
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 24 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
v0.23.3 - Fri, 12 Jun 2015 21:46:30 GMT
---------------------------------------

- [9ca26e9](../../commit/9ca26e9) [added] contains "polyfill" to domUtils
- [3a254a1](../../commit/3a254a1) [added] Deprecation warning for individual file use in the Bower release
- [73c7705](../../commit/73c7705) [changed] Update chai. Dev dependency.
- [3ca90c7](../../commit/3ca90c7) [changed] Update karma-sinon-chai. Dev dependency.
- [cc4e820](../../commit/cc4e820) [changed] Update fs-extra. Dev dependency.



v0.23.2 - Mon, 08 Jun 2015 18:56:48 GMT
---------------------------------------

Expand Down
Binary file modified docs/assets/favicon.ico
100644 → 100755
Binary file not shown.
Binary file modified docs/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/src/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Root = React.createClass({
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="${this.props.assetBaseUrl}/assets/bundle.css" rel="stylesheet">
<link href="${this.props.assetBaseUrl}/assets/favicon.ico" type="image/x-icon" rel="icon">
<link href="${this.props.assetBaseUrl}/assets/favicon.ico?v=2" type="image/x-icon" rel="shortcut icon">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"babel-loader": "^5.0.0",
"bootstrap": "^3.3.4",
"brfs": "^1.4.0",
"chai": "^2.2.0",
"chai": "^3.0.0",
"child-process-promise": "^1.0.1",
"codemirror": "^5.0.0",
"colors": "^1.0.3",
Expand All @@ -58,7 +58,7 @@
"express": "^4.12.3",
"extract-text-webpack-plugin": "^0.8.0",
"file-loader": "^0.8.1",
"fs-extra": "^0.18.0",
"fs-extra": "^0.19.0",
"fs-promise": "^0.3.1",
"glob": "^5.0.10",
"http-proxy": "^1.11.1",
Expand All @@ -73,7 +73,7 @@
"karma-mocha-reporter": "^1.0.2",
"karma-phantomjs-launcher": "^0.2.0",
"karma-sinon": "^1.0.3",
"karma-sinon-chai": "^0.3.0",
"karma-sinon-chai": "^1.0.0",
"karma-sourcemap-loader": "^0.3.4",
"karma-webpack": "^1.5.0",
"less": "^2.4.0",
Expand Down
20 changes: 1 addition & 19 deletions src/RootCloseWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,6 @@ import EventListener from './utils/EventListener';

// TODO: Merge this logic with dropdown logic once #526 is done.

/**
* Checks whether a node is within
* a root nodes tree
*
* @param {DOMElement} node
* @param {DOMElement} root
* @returns {boolean}
*/
function isNodeInRoot(node, root) {
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}

return false;
}

export default class RootCloseWrapper extends React.Component {
constructor(props) {
Expand All @@ -44,7 +26,7 @@ export default class RootCloseWrapper extends React.Component {
// If the click originated from within this component, don't do anything.
// e.srcElement is required for IE8 as e.target is undefined
let target = e.target || e.srcElement;
if (isNodeInRoot(target, React.findDOMNode(this))) {
if (domUtils.contains(React.findDOMNode(this), target)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/CustomPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const CustomPropTypes = {
*
* The element can be provided in two forms:
* - Directly passed
* - Or passed an object which has a `getDOMNode` method which will return the required DOM element
* - Or passed an object that has a `render` method
*
* @param props
* @param propName
Expand Down
25 changes: 25 additions & 0 deletions src/utils/domUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,32 @@ function offsetParentFunc(elem) {
return offsetParent || docElem;
}

/**
* Cross browser .contains() polyfill
* @param {HTMLElement} elem
* @param {HTMLElement} inner
* @return {bool}
*/
function contains(elem, inner){
function ie8Contains(root, node) {
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
}

return (elem && elem.contains)
? elem.contains(inner)
: (elem && elem.compareDocumentPosition)
? elem === inner || !!(elem.compareDocumentPosition(inner) & 16)
: ie8Contains(elem, inner);
}

export default {
contains,
ownerDocument,
getComputedStyles,
getOffset,
Expand Down

0 comments on commit 4b1e116

Please sign in to comment.