From 55ea161d9112c48f0c6fd85b2be5721ebec1bd9f Mon Sep 17 00:00:00 2001 From: Gabriel Florit Date: Mon, 1 Dec 2014 15:30:19 -0500 Subject: [PATCH] on read gist, render all Output code #119 --- src/js/components/Livecoding.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/js/components/Livecoding.jsx b/src/js/components/Livecoding.jsx index 9301c47..16b16bb 100644 --- a/src/js/components/Livecoding.jsx +++ b/src/js/components/Livecoding.jsx @@ -42,7 +42,8 @@ var Livecoding = React.createClass({ css: '', // Specify what mode we're currently editing. mode: 'html', - gistUrl: null + gistUrl: null, + outputAllCode: false }; }, @@ -55,6 +56,9 @@ var Livecoding = React.createClass({ // Get the current mode's content. var content = this.state[mode]; + // Should we render all? + var renderAll = this.renderAll.pop(); + // Render the application. This will recursively call // `render` on all the components. return ( @@ -69,6 +73,7 @@ var Livecoding = React.createClass({ javascript={this.state.javascript} css={this.state.css} mode={mode} + renderAll={renderAll} /> @@ -95,6 +100,7 @@ var Livecoding = React.createClass({ .then(function(response) { var gistUrl = 'https://gist.github.com/' + match[0]; var state = _.assign({}, response, {gistUrl: gistUrl}); + self.renderAll.push(true); self.setState(state); }).catch(function(error) { console.log('Error', error); @@ -206,7 +212,10 @@ var Livecoding = React.createClass({ }, // Store the desired function call after authentication. - afterAuthentication: [] + afterAuthentication: [], + + // Decide whether to render all code in Output. + renderAll: [] });