Skip to content

Commit 583febb

Browse files
committed
[removed] unnecessary functionality in React v0.14
1 parent 049e538 commit 583febb

File tree

4 files changed

+2
-79
lines changed

4 files changed

+2
-79
lines changed

src/Modal.js

-12
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,6 @@ const Modal = React.createClass({
325325
container.style.paddingRight = parseInt(this._originalPadding || 0, 10) + getScrollbarSize() + 'px';
326326
}
327327

328-
if (this.props.backdrop) {
329-
this.iosClickHack();
330-
}
331-
332328
this.setState(this._getStyles() //eslint-disable-line react/no-did-mount-set-state
333329
, () => this.focusModalContent());
334330
},
@@ -418,14 +414,6 @@ const Modal = React.createClass({
418414
}
419415
},
420416

421-
iosClickHack() {
422-
// IOS only allows click events to be delegated to the document on elements
423-
// it considers 'clickable' - anchors, buttons, etc. We fake a click handler on the
424-
// DOM nodes themselves. Remove if handled by React: https://github.com/facebook/react/issues/1169
425-
this.refs.modal.onclick = function () {};
426-
this.refs.backdrop.onclick = function () {};
427-
},
428-
429417
_getStyles() {
430418
if (!domUtils.canUseDom) {
431419
return {};

src/OverlayTrigger.js

-17
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import warning from 'warning';
88
import Overlay from './Overlay';
99

1010
import createChainedFunction from './utils/createChainedFunction';
11-
import createContextWrapper from './utils/createContextWrapper';
1211

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

264263
});
265264

266-
/**
267-
* Creates a new OverlayTrigger class that forwards the relevant context
268-
*
269-
* This static method should only be called at the module level, instead of in
270-
* e.g. a render() method, because it's expensive to create new classes.
271-
*
272-
* For example, you would want to have:
273-
*
274-
* > export default OverlayTrigger.withContext({
275-
* > myContextKey: React.PropTypes.object
276-
* > });
277-
*
278-
* and import this when needed.
279-
*/
280-
OverlayTrigger.withContext = createContextWrapper(OverlayTrigger, 'overlay');
281-
282265
export default OverlayTrigger;

src/utils/createContextWrapper.js

-47
This file was deleted.

test/OverlayTriggerSpec.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,19 @@ describe('OverlayTrigger', function() {
103103
}
104104
ContextReader.contextTypes = contextTypes;
105105

106-
const TriggerWithContext = OverlayTrigger.withContext(contextTypes);
107106
class ContextHolder extends React.Component {
108107
getChildContext() {
109108
return {key: 'value'};
110109
}
111110

112111
render() {
113112
return (
114-
<TriggerWithContext
113+
<OverlayTrigger
115114
trigger="click"
116115
overlay={<ContextReader />}
117116
>
118117
<button>button</button>
119-
</TriggerWithContext>
118+
</OverlayTrigger>
120119
);
121120
}
122121
}

0 commit comments

Comments
 (0)