-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update example and add an iframe hack
- Loading branch information
Showing
6 changed files
with
90 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import SplitterLayout from '../../../index'; | ||
import Lorem from './Lorem'; | ||
|
||
export default class LayoutWithIFrame extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.onDragStart = this.onDragStart.bind(this); | ||
this.onDragEnd = this.onDragEnd.bind(this); | ||
this.state = { | ||
dragging: false | ||
}; | ||
} | ||
|
||
onDragStart() { | ||
this.setState({ dragging: true }); | ||
} | ||
|
||
onDragEnd() { | ||
this.setState({ dragging: false }); | ||
} | ||
|
||
render() { | ||
return ( | ||
<SplitterLayout onDragStart={this.onDragStart} onDragEnd={this.onDragEnd}> | ||
<div className="my-pane"> | ||
<h2>1st Pane</h2> | ||
<p> | ||
This is the 1st pane, and this is the primary pane by default. | ||
The 2nd pane on the right contains an <code>iframe</code> from <code>https://example.com</code>. | ||
A simple hack is used so that dragging is not interfered. | ||
</p> | ||
<Lorem title="1st Pane" /> | ||
</div> | ||
<div className="my-iframe"> | ||
{this.state.dragging && <div className="my-iframe-overlay" />} | ||
<iframe src="https://example.com" /> | ||
</div> | ||
</SplitterLayout> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters