Merge branch 'master' into fix-1307-invalid-node-type-to-props

This commit is contained in:
Norbert de Langen 2017-06-23 15:45:07 +02:00 committed by GitHub
commit 51f4c9de71
2 changed files with 17 additions and 10 deletions

View File

@ -125,11 +125,7 @@ export default class Story extends React.Component {
_renderInline() {
return (
<div>
<div style={this.state.stylesheet.infoPage}>
<div style={this.state.stylesheet.infoBody}>
{this._getInfoHeader()}
</div>
</div>
{this._renderInlineHeader()}
<div>
{this._renderStory()}
</div>
@ -145,6 +141,19 @@ export default class Story extends React.Component {
);
}
_renderInlineHeader() {
const infoHeader = this._getInfoHeader();
return (
infoHeader &&
<div style={this.state.stylesheet.infoPage}>
<div style={this.state.stylesheet.infoBody}>
{infoHeader}
</div>
</div>
);
}
_renderOverlay() {
const linkStyle = {
...stylesheet.link.base,

View File

@ -12,14 +12,12 @@ export default class Server {
this.expressApp.use(storybook(options));
this.httpServer.on('request', this.expressApp);
this.wsServer = new ws.Server({ server: this.httpServer });
this.wsServer.on('connection', s => this.handleWS(s));
this.wsServer.on('connection', (s, req) => this.handleWS(s, req));
}
handleWS(socket) {
handleWS(socket, req) {
if (this.options.manualId) {
const params = socket.upgradeReq && socket.upgradeReq.url
? querystring.parse(socket.upgradeReq.url.substr(1))
: {};
const params = req.url ? querystring.parse(req.url.substr(1)) : {};
if (params.pairedId) {
socket.pairedId = params.pairedId; // eslint-disable-line