mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-30 18:20:15 +02:00
fix prettier for JS
This commit is contained in:
@@ -904,7 +904,7 @@ export default class ContentWrap extends Component {
|
|||||||
<a
|
<a
|
||||||
class="code-wrap__header-btn "
|
class="code-wrap__header-btn "
|
||||||
title="Format code"
|
title="Format code"
|
||||||
onClick={this.prettifyBtnClickHandler.bind(this, 'css')}
|
onClick={this.prettifyBtnClickHandler.bind(this, 'js')}
|
||||||
>
|
>
|
||||||
<svg>
|
<svg>
|
||||||
<use xlinkHref="#code-brace-icon" />
|
<use xlinkHref="#code-brace-icon" />
|
||||||
|
@@ -1687,7 +1687,7 @@ export default class App extends Component {
|
|||||||
// 3 pane mode
|
// 3 pane mode
|
||||||
if (typeof what === 'string') {
|
if (typeof what === 'string') {
|
||||||
prettify({
|
prettify({
|
||||||
content: this.state.currentItem[what],
|
content: this.state.currentItem[what] || '',
|
||||||
type: { html: 'html', js: 'js', css: 'css' }[what]
|
type: { html: 'html', js: 'js', css: 'css' }[what]
|
||||||
}).then(formattedContent => {
|
}).then(formattedContent => {
|
||||||
if (this.state.currentItem[what] === formattedContent) {
|
if (this.state.currentItem[what] === formattedContent) {
|
||||||
@@ -1708,6 +1708,7 @@ export default class App extends Component {
|
|||||||
...this.state.currentItem,
|
...this.state.currentItem,
|
||||||
files: [...this.state.currentItem.files]
|
files: [...this.state.currentItem.files]
|
||||||
};
|
};
|
||||||
|
|
||||||
prettify({ file: selectedFile }).then(formattedContent => {
|
prettify({ file: selectedFile }).then(formattedContent => {
|
||||||
if (formattedContent !== selectedFile.content) {
|
if (formattedContent !== selectedFile.content) {
|
||||||
selectedFile.content = formattedContent;
|
selectedFile.content = formattedContent;
|
||||||
|
Reference in New Issue
Block a user