File tree 2 files changed +1
-58
lines changed
2 files changed +1
-58
lines changed Original file line number Diff line number Diff line change @@ -6,46 +6,16 @@ var appElement = document.getElementById('example');
6
6
7
7
Modal . setAppElement ( '#example' ) ;
8
8
9
- Modal . defaultStyles = {
10
- overlay : {
11
- position : 'fixed' ,
12
- top : 0 ,
13
- left : 0 ,
14
- right : 0 ,
15
- bottom : 0 ,
16
- backgroundColor : 'rebeccapurple'
17
- } ,
18
- content : {
19
- position : 'absolute' ,
20
- top : '40px' ,
21
- left : '40px' ,
22
- right : '40px' ,
23
- bottom : '40px' ,
24
- border : '1px solid #ccc' ,
25
- background : '#fff' ,
26
- overflow : 'auto' ,
27
- WebkitOverflowScrolling : 'touch' ,
28
- borderRadius : '4px' ,
29
- outline : 'none' ,
30
- padding : '20px'
31
-
32
- }
33
- }
34
-
35
9
var App = React . createClass ( {
36
10
37
11
getInitialState : function ( ) {
38
- return { modalIsOpen : false , modalIsOpen2 : false } ;
12
+ return { modalIsOpen : false } ;
39
13
} ,
40
14
41
15
openModal : function ( ) {
42
16
this . setState ( { modalIsOpen : true } ) ;
43
17
} ,
44
18
45
- openModal2 : function ( ) {
46
- this . setState ( { modalIsOpen2 : true } ) ;
47
- } ,
48
-
49
19
closeModal : function ( ) {
50
20
this . setState ( { modalIsOpen : false } ) ;
51
21
} ,
@@ -69,7 +39,6 @@ var App = React.createClass({
69
39
return (
70
40
< div >
71
41
< button onClick = { this . openModal } > Open Modal</ button >
72
- < button onClick = { this . openModal2 } > Open Modal 2</ button >
73
42
< Modal
74
43
ref = "mymodal"
75
44
closeTimeoutMS = { 150 }
@@ -92,27 +61,6 @@ var App = React.createClass({
92
61
< button > hi</ button >
93
62
</ form >
94
63
</ Modal >
95
- < Modal
96
- closeTimeoutMS = { 150 }
97
- isOpen = { this . state . modalIsOpen2 }
98
- onRequestClose = { this . handleModalCloseRequest }
99
- >
100
- < h1 > Hello</ h1 >
101
- < button onClick = { this . closeModal } > close</ button >
102
- < div > I am a modal</ div >
103
- < form >
104
- < input onChange = { this . handleInputChange } />
105
- < input />
106
- < input />
107
- < input />
108
- < input />
109
- < br />
110
- < button > hi</ button >
111
- < button > hi</ button >
112
- < button > hi</ button >
113
- < button > hi</ button >
114
- </ form >
115
- </ Modal >
116
64
</ div >
117
65
) ;
118
66
}
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ var Modal = React.createClass({
55
55
} ,
56
56
57
57
componentWillReceiveProps : function ( newProps ) {
58
- sanitizeProps ( newProps ) ;
59
58
this . renderPortal ( newProps ) ;
60
59
} ,
61
60
@@ -110,7 +109,3 @@ Modal.defaultStyles = {
110
109
}
111
110
112
111
module . exports = Modal
113
-
114
- function sanitizeProps ( props ) {
115
- delete props . ref ;
116
- }
You can’t perform that action at this time.
0 commit comments