Skip to content

Commit d8076ea

Browse files
author
Zhou
committed
fix bug
1 parent 697c5c3 commit d8076ea

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/pages/PageFour/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class PageFour extends React.Component {
8484

8585
componentDidMount() {
8686
this.updateWindowDimensions();
87-
window.addEventListener('resize', this.updateWindowDimensions);
87+
this.refDom.addEventListener('resize', this.updateWindowDimensions);
8888
// this.data = {
8989
// action: 'loadfile'
9090
// }
@@ -94,7 +94,8 @@ class PageFour extends React.Component {
9494
}
9595

9696
receiveMessageFromPlugin ( event ) {
97-
console.log( 'iframe is working:', event.data );
97+
if(event.origin!= "http://localhost:3000"){
98+
console.log( 'iframe is working:', event.origin );
9899
let contentObject = {};
99100

100101
const content = localStorage.getItem('fileContent');
@@ -114,7 +115,7 @@ class PageFour extends React.Component {
114115
})
115116
this.setState({drawSprites: allStages[0]})
116117
}
117-
118+
}
118119
}
119120

120121
highlight(index) {

src/pages/PageFour/index.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
.left {
1212
// flex-grow: 1;
13-
max-width: 300px;
13+
width: 300px;
1414
}
1515

1616
.left_upper {
@@ -29,7 +29,7 @@
2929

3030
.right {
3131
// flex-grow: 1;
32-
width: 250px;
32+
width: 220px;
3333
}
3434

3535
.stage_item {

0 commit comments

Comments
 (0)