This commit is contained in:
Cassie Tarakajian 2017-01-31 16:45:47 -05:00
parent 509bb6bd8e
commit ad62d20544
2 changed files with 14 additions and 2 deletions

View file

@ -61,6 +61,7 @@ class Toolbar extends React.Component {
<button
className="toolbar__play-sketch-button"
onClick={() => {
this.props.clearConsole();
this.props.startTextOutput();
this.props.startSketchAndRefresh();
}}
@ -69,7 +70,15 @@ class Toolbar extends React.Component {
>
<InlineSVG src={playUrl} alt="Play Sketch" />
</button>
<button className={playButtonClass} onClick={this.props.startSketchAndRefresh} aria-label="play only visual sketch" disabled={this.props.infiniteLoop} >
<button
className={playButtonClass}
onClick={() => {
this.props.clearConsole();
this.props.startSketchAndRefresh();
}}
aria-label="play only visual sketch"
disabled={this.props.infiniteLoop}
>
<InlineSVG src={playUrl} alt="Play only visual Sketch" />
</button>
<button
@ -169,7 +178,8 @@ Toolbar.propTypes = {
setAutorefresh: PropTypes.func.isRequired,
startSketchAndRefresh: PropTypes.func.isRequired,
saveProject: PropTypes.func.isRequired,
currentUser: PropTypes.string
currentUser: PropTypes.string,
clearConsole: PropTypes.func.isRequired
};
export default Toolbar;

View file

@ -151,6 +151,7 @@ class IDEView extends React.Component {
} else if (e.keyCode === 13 && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac))) {
e.preventDefault();
e.stopPropagation();
this.props.clearConsole();
this.props.startSketchAndRefresh();
} else if (e.keyCode === 50 && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac)) && e.shiftKey) {
e.preventDefault();
@ -220,6 +221,7 @@ class IDEView extends React.Component {
startSketchAndRefresh={this.props.startSketchAndRefresh}
saveProject={this.props.saveProject}
currentUser={this.props.user.username}
clearConsole={this.props.clearConsole}
/>
<Preferences
isVisible={this.props.ide.preferencesIsVisible}