This repository has been archived by the owner on May 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
203 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,27 @@ | ||
.Overlay { | ||
position: fixed; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
background: rgba(#32292c, 0.8); | ||
color: #f0f0f0; | ||
} | ||
|
||
.Overlay-inner { | ||
overflow-y: auto; | ||
height: 100%; | ||
} | ||
|
||
.Overlay-content { | ||
width: 600px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
display: table; | ||
height: 100%; | ||
} | ||
|
||
.Overlay-contentInner { | ||
display: table-cell; | ||
vertical-align: middle; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* @jsx React.DOM | ||
*/ | ||
|
||
var React = require('react'); | ||
var LayeredComponentMixin = require('../mixins/LayeredComponentMixin'); | ||
|
||
var BuildOptionsOverlay = React.createClass({ | ||
|
||
mixins: [ | ||
LayeredComponentMixin | ||
], | ||
|
||
renderLayer: function() { | ||
return ( | ||
<div className="Overlay" onClick={this.props.onClick}> | ||
<div className="Overlay-inner"> | ||
<div className="Overlay-content" style={{pointerEvents: 'none'}}> | ||
<div className="Overlay-contentInner" onClick={this._onContentClick}> | ||
<div className="BoxSet" style={{pointerEvents: 'auto'}}> | ||
<div className="BoxSet-item c-base"> | ||
<div className="Box t-body" style={{overflow: 'hidden'}}> | ||
<div style={{'float': 'left'}}>Unminfied</div> | ||
<div style={{'float': 'right'}}>(<a className="c-action" href="#">Download</a> | <a className="c-action" href="#">Copy to clipboard</a>)</div> | ||
</div> | ||
</div> | ||
<div className="BoxSet-item c-base"> | ||
<div className="Box t-body" style={{overflow: 'hidden'}}> | ||
<div style={{'float': 'left'}}>Minified</div> | ||
<div style={{'float': 'right'}}>(<a className="c-action" href="#">Download</a> | <a className="c-action" href="#">Copy to clipboard</a>)</div> | ||
</div> | ||
</div> | ||
<div className="BoxSet-item c-base"> | ||
<div className="Box t-body" style={{overflow: 'hidden'}}> | ||
<div style={{'float': 'left'}}>Grunt configuration</div> | ||
<div style={{'float': 'right'}}>(<a className="c-action" href="#">Download</a> | <a className="c-action" href="#">Copy to clipboard</a>)</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}, | ||
|
||
_onContentClick: function(event) { | ||
event.stopPropagation(); | ||
}, | ||
|
||
render: function() { | ||
return (<span />); | ||
} | ||
}); | ||
|
||
module.exports = BuildOptionsOverlay; |
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,58 @@ | ||
// From http://jsfiddle.net/LBAr8/ | ||
|
||
/* Create a new "layer" on the page, like a modal or overlay. | ||
* | ||
* var LayeredComponent = React.createClass({ | ||
* mixins: [LayeredComponentMixin], | ||
* render: function() { | ||
* // render like usual | ||
* }, | ||
* renderLayer: function() { | ||
* // render a separate layer (the modal or overlay) | ||
* } | ||
* }); | ||
*/ | ||
|
||
var React = require('react'); | ||
|
||
var LayeredComponentMixin = { | ||
componentDidMount: function() { | ||
// Appending to the body is easier than managing the z-index of | ||
// everything on the page. It's also better for accessibility and | ||
// makes stacking a snap (since components will stack in mount order). | ||
this._layer = document.createElement('div'); | ||
document.body.appendChild(this._layer); | ||
this._renderLayer(); | ||
}, | ||
|
||
componentDidUpdate: function() { | ||
this._renderLayer(); | ||
}, | ||
|
||
componentWillUnmount: function() { | ||
this._unrenderLayer(); | ||
document.body.removeChild(this._layer); | ||
}, | ||
|
||
_renderLayer: function() { | ||
// By calling this method in componentDidMount() and | ||
// componentDidUpdate(), you're effectively creating a "wormhole" that | ||
// funnels React's hierarchical updates through to a DOM node on an | ||
// entirely different part of the page. | ||
React.renderComponent(this.renderLayer(), this._layer); | ||
|
||
if (this.layerDidMount) { | ||
this.layerDidMount(this._layer); | ||
} | ||
}, | ||
|
||
_unrenderLayer: function() { | ||
if (this.layerWillUnmount) { | ||
this.layerWillUnmount(this._layer); | ||
} | ||
|
||
React.unmountComponentAtNode(this._layer); | ||
} | ||
}; | ||
|
||
module.exports = LayeredComponentMixin; |