mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-30 02:00:10 +02:00
minor fixes and dead code removal
This commit is contained in:
@@ -193,7 +193,7 @@ export default class ContentWrapFiles extends Component {
|
|||||||
this.props.onCodeChange(
|
this.props.onCodeChange(
|
||||||
this.state.selectedFile,
|
this.state.selectedFile,
|
||||||
this.cmCodes.html,
|
this.cmCodes.html,
|
||||||
change ? change.origin !== 'setValue' : true
|
change.origin !== 'setValue'
|
||||||
);
|
);
|
||||||
this.onCodeChange(change);
|
this.onCodeChange(change);
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,7 @@ export default class ContentWrapFiles extends Component {
|
|||||||
this.updateTimer = setTimeout(() => {
|
this.updateTimer = setTimeout(() => {
|
||||||
// This is done so that multiple simultaneous setValue don't trigger too many preview refreshes
|
// This is done so that multiple simultaneous setValue don't trigger too many preview refreshes
|
||||||
// and in turn too many file writes on a single file (eg. preview.html).
|
// and in turn too many file writes on a single file (eg. preview.html).
|
||||||
if (change ? change.origin !== 'setValue' : true) {
|
if (change.origin !== 'setValue') {
|
||||||
// Specifically checking for false so that the condition doesn't get true even
|
// Specifically checking for false so that the condition doesn't get true even
|
||||||
// on absent key - possible when the setting key hasn't been fetched yet.
|
// on absent key - possible when the setting key hasn't been fetched yet.
|
||||||
if (this.prefs.autoPreview !== false) {
|
if (this.prefs.autoPreview !== false) {
|
||||||
@@ -260,9 +260,7 @@ export default class ContentWrapFiles extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
cleanupErrors() {
|
cleanupErrors() {
|
||||||
if (!this.props.prefs.isMonacoEditorOn) {
|
this.editor.clearGutter('error-gutter');
|
||||||
// this.editor.clearGutter('error-gutter');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showErrors(lang, errors) {
|
showErrors(lang, errors) {
|
||||||
@@ -416,7 +414,6 @@ export default class ContentWrapFiles extends Component {
|
|||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
this.updateSplits();
|
this.updateSplits();
|
||||||
// this.editor.refresh();
|
|
||||||
}
|
}
|
||||||
mainSplitDragHandler() {
|
mainSplitDragHandler() {
|
||||||
this.previewDimension.update({
|
this.previewDimension.update({
|
||||||
@@ -532,15 +529,7 @@ export default class ContentWrapFiles extends Component {
|
|||||||
if (this.fileBuffers[file.path].state) {
|
if (this.fileBuffers[file.path].state) {
|
||||||
this.editor.restoreViewState(this.fileBuffers[file.path].state);
|
this.editor.restoreViewState(this.fileBuffers[file.path].state);
|
||||||
}
|
}
|
||||||
// var cmMode = 'html';
|
|
||||||
// if (file.name.match(/\.css$/)) {
|
|
||||||
// this.updateCssMode('css');
|
|
||||||
// } else if (file.name.match(/\.js$/)) {
|
|
||||||
// this.updateCssMode('js');
|
|
||||||
// } else {
|
|
||||||
// this.updateCssMode('html');
|
|
||||||
// }
|
|
||||||
// this.cm.setValue(file.content || '');
|
|
||||||
this.editor.focus();
|
this.editor.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1528,20 +1528,6 @@ export default class App extends Component {
|
|||||||
|
|
||||||
<Alerts />
|
<Alerts />
|
||||||
|
|
||||||
<form
|
|
||||||
style="display:none;"
|
|
||||||
action="https://codepen.io/pen/define"
|
|
||||||
method="POST"
|
|
||||||
target="_blank"
|
|
||||||
id="js-codepen-form"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="hidden"
|
|
||||||
name="data"
|
|
||||||
value='{"title": "New Pen!", "html": "<div>Hello, World!</div>"}'
|
|
||||||
/>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
show={this.state.isAddLibraryModalOpen}
|
show={this.state.isAddLibraryModalOpen}
|
||||||
closeHandler={() => this.setState({ isAddLibraryModalOpen: false })}
|
closeHandler={() => this.setState({ isAddLibraryModalOpen: false })}
|
||||||
|
Reference in New Issue
Block a user