mirror of
https://github.com/chinchang/web-maker.git
synced 2025-04-05 03:12:25 +02:00
minor fixes
This commit is contained in:
parent
359b270295
commit
36e148d359
@ -152,10 +152,10 @@ export default class ContentWrap extends Component {
|
||||
var blobjs = new Blob([js], { type: 'text/plain;charset=UTF-8' });
|
||||
|
||||
// Track if people have written code.
|
||||
// if (!trackEvent.hasTrackedCode && (html || css || js)) {
|
||||
// trackEvent('fn', 'hasCode');
|
||||
// trackEvent.hasTrackedCode = true;
|
||||
// }
|
||||
if (!trackEvent.hasTrackedCode && (html || css || js)) {
|
||||
trackEvent('fn', 'hasCode');
|
||||
trackEvent.hasTrackedCode = true;
|
||||
}
|
||||
|
||||
if (shouldInlineJs) {
|
||||
if (this.detachedWindow) {
|
||||
@ -194,11 +194,11 @@ export default class ContentWrap extends Component {
|
||||
* @param {boolean} isManual Is this a manual preview request from user?
|
||||
*/
|
||||
setPreviewContent(isForced, isManual) {
|
||||
if (!this.prefs.autoPreview && !isManual) {
|
||||
// return;
|
||||
if (!this.props.prefs.autoPreview && !isManual) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.prefs.preserveConsoleLogs) {
|
||||
if (!this.props.prefs.preserveConsoleLogs) {
|
||||
this.clearConsole();
|
||||
}
|
||||
|
||||
@ -318,7 +318,7 @@ export default class ContentWrap extends Component {
|
||||
this.cm[type].setOption('tabSize', +prefs.indentSize);
|
||||
this.cm[type].setOption('theme', prefs.editorTheme);
|
||||
|
||||
// this.cm[type].setOption('keyMap', prefs.keymap);
|
||||
this.cm[type].setOption('keyMap', prefs.keymap);
|
||||
this.cm[type].setOption('lineWrapping', prefs.lineWrap);
|
||||
this.cm[type].refresh();
|
||||
});
|
||||
@ -634,6 +634,7 @@ export default class ContentWrap extends Component {
|
||||
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
|
||||
noAutocomplete: true,
|
||||
matchTags: { bothTags: true }
|
||||
// emmet: true
|
||||
}}
|
||||
onChange={this.onHtmlCodeChange.bind(this)}
|
||||
onCreation={el => (this.cm.html = el)}
|
||||
@ -691,14 +692,13 @@ export default class ContentWrap extends Component {
|
||||
'error-gutter',
|
||||
'CodeMirror-linenumbers',
|
||||
'CodeMirror-foldgutter'
|
||||
],
|
||||
noAutocomplete: true
|
||||
|
||||
]
|
||||
// emmet: true
|
||||
}}
|
||||
onChange={this.onCssCodeChange.bind(this)}
|
||||
onCreation={el => (this.cm.css = el)}
|
||||
/>
|
||||
{/* Inlet(scope.cm.css); */}
|
||||
</div>
|
||||
<div
|
||||
data-code-wrap-id="2"
|
||||
@ -741,12 +741,12 @@ export default class ContentWrap extends Component {
|
||||
'error-gutter',
|
||||
'CodeMirror-linenumbers',
|
||||
'CodeMirror-foldgutter'
|
||||
],
|
||||
noAutocomplete: true
|
||||
]
|
||||
}}
|
||||
onChange={this.onJsCodeChange.bind(this)}
|
||||
onCreation={el => (this.cm.js = el)}
|
||||
/>
|
||||
{/* Inlet(scope.cm.js); */}
|
||||
</div>
|
||||
</SplitPane>
|
||||
<div class="demo-side" id="js-demo-side">
|
||||
|
@ -51,7 +51,7 @@ export default class UserCodeMirror extends Component {
|
||||
matchBrackets: true,
|
||||
matchTags: options.matchTags || false,
|
||||
tabMode: 'indent',
|
||||
// keyMap: 'sublime',
|
||||
keyMap: 'sublime',
|
||||
theme: 'monokai',
|
||||
lint: !!options.lint,
|
||||
tabSize: 2,
|
||||
|
@ -112,9 +112,9 @@ export default class App extends Component {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// User is signed out.
|
||||
this.setState({ user: undefined });
|
||||
delete window.user;
|
||||
// User is signed out.
|
||||
}
|
||||
this.updateProfileUi();
|
||||
});
|
||||
@ -293,7 +293,6 @@ export default class App extends Component {
|
||||
// setTimeout(() => $('#js-saved-items-wrap').style.overflowY = 'auto', 1000);
|
||||
}
|
||||
toggleSavedItemsPane(shouldOpen) {
|
||||
// const savedItemsPane = $('#js-saved-items-pane');
|
||||
this.setState({ isSavedItemPaneOpen: !this.state.isSavedItemPaneOpen });
|
||||
|
||||
if (this.state.isSavedItemPaneOpen) {
|
||||
@ -366,7 +365,6 @@ export default class App extends Component {
|
||||
});
|
||||
this.populateItemsInSavedPane(items);
|
||||
});
|
||||
// this.setState({ isSavedItemPaneOpen: true });
|
||||
}
|
||||
openAddLibrary() {
|
||||
this.setState({ isAddLibraryModalOpen: true });
|
||||
@ -464,7 +462,7 @@ export default class App extends Component {
|
||||
this.setState({
|
||||
currentItem: { ...this.state.currentItem }
|
||||
});
|
||||
// this.contentWrap.setPreviewContent(true);
|
||||
this.contentWrap.setPreviewContent(true);
|
||||
alertsService.add('Libraries updated.');
|
||||
}
|
||||
updateExternalLibCount() {
|
||||
@ -748,6 +746,10 @@ export default class App extends Component {
|
||||
this.createNewItem();
|
||||
}
|
||||
}
|
||||
openBtnClickHandler() {
|
||||
trackEvent('ui', 'openBtnClick');
|
||||
this.openSavedItemsPane();
|
||||
}
|
||||
detachedPreviewBtnHandler() {
|
||||
trackEvent('ui', 'detachPreviewBtnClick');
|
||||
|
||||
@ -760,7 +762,7 @@ export default class App extends Component {
|
||||
<div class="main-container">
|
||||
<MainHeader
|
||||
externalLibCount={this.state.externalLibCount}
|
||||
openBtnHandler={this.openSavedItemsPane.bind(this)}
|
||||
openBtnHandler={this.openBtnClickHandler.bind(this)}
|
||||
newBtnHandler={this.newBtnClickHandler.bind(this)}
|
||||
saveBtnHandler={this.saveBtnClickHandler.bind(this)}
|
||||
loginBtnHandler={this.loginBtnClickHandler.bind(this)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user