Skip to content

Commit

Permalink
[removed] unnecessary functionality in React v0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
taion committed Aug 13, 2015
1 parent 049e538 commit 583febb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 79 deletions.
12 changes: 0 additions & 12 deletions src/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,6 @@ const Modal = React.createClass({
container.style.paddingRight = parseInt(this._originalPadding || 0, 10) + getScrollbarSize() + 'px';
}

if (this.props.backdrop) {
this.iosClickHack();
}

this.setState(this._getStyles() //eslint-disable-line react/no-did-mount-set-state
, () => this.focusModalContent());
},
Expand Down Expand Up @@ -418,14 +414,6 @@ const Modal = React.createClass({
}
},

iosClickHack() {
// IOS only allows click events to be delegated to the document on elements
// it considers 'clickable' - anchors, buttons, etc. We fake a click handler on the
// DOM nodes themselves. Remove if handled by React: https://github.com/facebook/react/issues/1169
this.refs.modal.onclick = function () {};
this.refs.backdrop.onclick = function () {};
},

_getStyles() {
if (!domUtils.canUseDom) {
return {};
Expand Down
17 changes: 0 additions & 17 deletions src/OverlayTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import warning from 'warning';
import Overlay from './Overlay';

import createChainedFunction from './utils/createChainedFunction';
import createContextWrapper from './utils/createContextWrapper';

/**
* Check if value one is inside or equal to the of value
Expand Down Expand Up @@ -263,20 +262,4 @@ const OverlayTrigger = React.createClass({

});

/**
* Creates a new OverlayTrigger class that forwards the relevant context
*
* This static method should only be called at the module level, instead of in
* e.g. a render() method, because it's expensive to create new classes.
*
* For example, you would want to have:
*
* > export default OverlayTrigger.withContext({
* > myContextKey: React.PropTypes.object
* > });
*
* and import this when needed.
*/
OverlayTrigger.withContext = createContextWrapper(OverlayTrigger, 'overlay');

export default OverlayTrigger;
47 changes: 0 additions & 47 deletions src/utils/createContextWrapper.js

This file was deleted.

5 changes: 2 additions & 3 deletions test/OverlayTriggerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,19 @@ describe('OverlayTrigger', function() {
}
ContextReader.contextTypes = contextTypes;

const TriggerWithContext = OverlayTrigger.withContext(contextTypes);
class ContextHolder extends React.Component {
getChildContext() {
return {key: 'value'};
}

render() {
return (
<TriggerWithContext
<OverlayTrigger
trigger="click"
overlay={<ContextReader />}
>
<button>button</button>
</TriggerWithContext>
</OverlayTrigger>
);
}
}
Expand Down

0 comments on commit 583febb

Please sign in to comment.