From 8116e9cb38c0de6c9495142e5eee8093b872f46b Mon Sep 17 00:00:00 2001 From: Cheng Lou Date: Mon, 10 Feb 2014 23:22:59 -0800 Subject: [PATCH] [Docs] Hide compiled js tab in jsx-compiler.html Fixes #1049 --- _js/jsx-compiler.js | 3 ++- _js/live_editor.js | 35 +++++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/_js/jsx-compiler.js b/_js/jsx-compiler.js index 0e703d7f..cbc1a3cf 100644 --- a/_js/jsx-compiler.js +++ b/_js/jsx-compiler.js @@ -21,6 +21,7 @@ React.renderComponent( codeText={HELLO_COMPONENT} renderCode={true} transformer={transformer} - />, + showCompiledJSTab={false} + />, document.getElementById('jsxCompiler') ); diff --git a/_js/live_editor.js b/_js/live_editor.js index 955e2825..1af8fa22 100644 --- a/_js/live_editor.js +++ b/_js/live_editor.js @@ -85,7 +85,8 @@ var ReactPlayground = React.createClass({ return { transformer: function(code) { return JSXTransformer.transform(code).code; - } + }, + showCompiledJSTab: true }; }, @@ -116,7 +117,7 @@ var ReactPlayground = React.createClass({ compiledCode = this.compileCode(); } catch (err) {} - var jsContent = + var JSContent = ; - var jsxContent = + var JSXContent = + Compiled JS + ; + + var JSXTab = +
+ Live JSX Editor +
+ return (
-
- Live JSX Editor -
-
- Compiled JS -
+ {JSXTab} + {this.props.showCompiledJSTab && JSTab}
- {isJS ? jsContent : jsxContent} + {isJS ? JSContent : JSXContent}