File tree 6 files changed +12
-10
lines changed
6 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ const AffixMixin = {
104
104
this . _onWindowScrollListener =
105
105
EventListener . listen ( window , 'scroll' , this . checkPosition ) ;
106
106
this . _onDocumentClickListener =
107
- EventListener . listen ( document , 'click' , this . checkPositionWithEventLoop ) ;
107
+ EventListener . listen ( React . findDOMNode ( this ) . ownerDocument , 'click' , this . checkPositionWithEventLoop ) ;
108
108
} ,
109
109
110
110
componentWillUnmount ( ) {
Original file line number Diff line number Diff line change @@ -56,10 +56,12 @@ const DropdownStateMixin = {
56
56
} ,
57
57
58
58
bindRootCloseHandlers ( ) {
59
+ let doc = React . findDOMNode ( this ) . ownerDocument ;
60
+
59
61
this . _onDocumentClickListener =
60
- EventListener . listen ( document , 'click' , this . handleDocumentClick ) ;
62
+ EventListener . listen ( doc , 'click' , this . handleDocumentClick ) ;
61
63
this . _onDocumentKeyupListener =
62
- EventListener . listen ( document , 'keyup' , this . handleDocumentKeyUp ) ;
64
+ EventListener . listen ( doc , 'keyup' , this . handleDocumentKeyUp ) ;
63
65
} ,
64
66
65
67
unbindRootCloseHandlers ( ) {
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ export default {
57
57
58
58
componentWillUnmount : function ( ) {
59
59
let els = getElementsAndSelf ( React . findDOMNode ( this ) , [ 'fade' ] ) ,
60
- container = ( this . props . container && React . findDOMNode ( this . props . container ) ) || document . body ;
60
+ container = ( this . props . container && React . findDOMNode ( this . props . container ) ) || React . findDOMNode ( this ) . ownerDocument . body ;
61
61
62
62
if ( els . length ) {
63
63
this . _fadeOutEl = document . createElement ( 'div' ) ;
Original file line number Diff line number Diff line change @@ -128,9 +128,9 @@ const Modal = React.createClass({
128
128
129
129
componentDidMount ( ) {
130
130
this . _onDocumentKeyupListener =
131
- EventListener . listen ( document , 'keyup' , this . handleDocumentKeyUp ) ;
131
+ EventListener . listen ( React . findDOMNode ( this ) . ownerDocument , 'keyup' , this . handleDocumentKeyUp ) ;
132
132
133
- let container = ( this . props . container && React . findDOMNode ( this . props . container ) ) || document . body ;
133
+ let container = ( this . props . container && React . findDOMNode ( this . props . container ) ) || React . findDOMNode ( this ) . ownerDocument . body ;
134
134
container . className += container . className . length ? ' modal-open' : 'modal-open' ;
135
135
136
136
if ( this . props . backdrop ) {
@@ -146,7 +146,7 @@ const Modal = React.createClass({
146
146
147
147
componentWillUnmount ( ) {
148
148
this . _onDocumentKeyupListener . remove ( ) ;
149
- let container = ( this . props . container && React . findDOMNode ( this . props . container ) ) || document . body ;
149
+ let container = ( this . props . container && React . findDOMNode ( this . props . container ) ) || React . findDOMNode ( this ) . ownerDocument . body ;
150
150
container . className = container . className . replace ( / ? m o d a l - o p e n / , '' ) ;
151
151
} ,
152
152
Original file line number Diff line number Diff line change @@ -63,6 +63,6 @@ export default {
63
63
} ,
64
64
65
65
getContainerDOMNode ( ) {
66
- return React . findDOMNode ( this . props . container || document . body ) ;
66
+ return React . findDOMNode ( this . props . container || React . findDOMNode ( this ) . ownerDocument . body ) ;
67
67
}
68
68
} ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ function getOffset(DOMNode) {
21
21
return window . jQuery ( DOMNode ) . offset ( ) ;
22
22
}
23
23
24
- let docElem = document . documentElement ;
24
+ let docElem = DOMNode . ownerDocument . documentElement ;
25
25
let box = { top : 0 , left : 0 } ;
26
26
27
27
// If we don't have gBCR, just use 0,0 rather than error
@@ -89,7 +89,7 @@ function getPosition(elem, offsetParent) {
89
89
* @returns {HTMLElement }
90
90
*/
91
91
function offsetParentFunc ( elem ) {
92
- let docElem = document . documentElement ;
92
+ let docElem = elem . ownerDocument . documentElement ;
93
93
let offsetParent = elem . offsetParent || docElem ;
94
94
95
95
while ( offsetParent && ( offsetParent . nodeName !== 'HTML' &&
You can’t perform that action at this time.
0 commit comments