Compare commits
2 commits
f181bc6cb7
...
fa5e7cceb1
Author | SHA1 | Date | |
---|---|---|---|
|
fa5e7cceb1 | ||
|
b231b6b7e3 |
5 changed files with 11 additions and 7 deletions
|
@ -262,7 +262,7 @@ function generateNewIdsForChildren(file, files) {
|
|||
export function cloneProject(id) {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(setUnsavedChanges(false));
|
||||
new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!id) {
|
||||
resolve(getState());
|
||||
} else {
|
||||
|
|
|
@ -58,11 +58,14 @@ class Toolbar extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const canEditProjectName = this.canEditProjectName();
|
||||
|
||||
const playButtonClass = classNames({
|
||||
'toolbar__play-button': true,
|
||||
'toolbar__play-button--selected': this.props.isPlaying,
|
||||
'toolbar__play-button--saved': this.props.isSaved,
|
||||
'toolbar__play-button--unsaved': !this.props.isSaved
|
||||
'toolbar__play-button--unsaved': !this.props.isSaved,
|
||||
'toolbar__play-button--clone': this.props.unsavedChanges && !canEditProjectName
|
||||
});
|
||||
const stopButtonClass = classNames({
|
||||
'toolbar__stop-button': true,
|
||||
|
@ -77,8 +80,6 @@ class Toolbar extends React.Component {
|
|||
'toolbar__project-name-container--editing': this.props.project.isEditingName
|
||||
});
|
||||
|
||||
const canEditProjectName = this.canEditProjectName();
|
||||
|
||||
return (
|
||||
<div className="toolbar">
|
||||
<button
|
||||
|
@ -178,6 +179,7 @@ class Toolbar extends React.Component {
|
|||
|
||||
Toolbar.propTypes = {
|
||||
isPlaying: PropTypes.bool.isRequired,
|
||||
unsavedChanges: PropTypes.bool.isRequired,
|
||||
isSaved: PropTypes.bool.isRequired,
|
||||
preferencesIsVisible: PropTypes.bool.isRequired,
|
||||
stopSketch: PropTypes.func.isRequired,
|
||||
|
@ -221,6 +223,7 @@ function mapStateToProps(state) {
|
|||
isSaved: state.project.updatedAt !== '',
|
||||
preferencesIsVisible: state.ide.preferencesIsVisible,
|
||||
project: state.project,
|
||||
unsavedChanges: state.ide.unsavedChanges,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -183,6 +183,7 @@ class IDEView extends React.Component {
|
|||
console.trace('project to save:', this.props.project);
|
||||
return this.props.saveProject(this.cmController.getContent());
|
||||
} else if (this.props.user.authenticated) {
|
||||
console.log('cloning!');
|
||||
return this.props.cloneProject();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
.toolbar__play-button {
|
||||
&--unsaved {
|
||||
&--unsaved, &--clone {
|
||||
// for some reason, I cannot manage to have PreviewFrame save _and_ actuall yload the project (it stops the playback)
|
||||
// pressing twice works. So just show a floppy the first time around :-)
|
||||
svg {
|
||||
|
|
4
dist/static/assets/webcam.js
vendored
4
dist/static/assets/webcam.js
vendored
|
@ -135,9 +135,9 @@ function preload() {
|
|||
for(let id in data) {
|
||||
images[id] = loadImage(data[id]);
|
||||
}
|
||||
console.log('images', data, images);
|
||||
// console.log('images', data, images);
|
||||
});
|
||||
console.log(images);
|
||||
// console.log(images);
|
||||
}
|
||||
|
||||
function setup() {
|
||||
|
|
Loading…
Reference in a new issue