small fixes changed PREVIEW_STATE to PREVIEW_HIDE
This commit is contained in:
parent
1f5db5ab3c
commit
948158cda3
@ -8,12 +8,12 @@ import PreviewPane from '../PreviewPane/PreviewPane';
|
|||||||
import Toolbar from './EntryEditorToolbar';
|
import Toolbar from './EntryEditorToolbar';
|
||||||
import styles from './EntryEditor.css';
|
import styles from './EntryEditor.css';
|
||||||
|
|
||||||
const PREVIEW_STATE = 'cms.preview-state';
|
const PREVIEW_HIDE = 'cms.preview-state';
|
||||||
|
|
||||||
class EntryEditor extends Component {
|
class EntryEditor extends Component {
|
||||||
state = {
|
state = {
|
||||||
showEventBlocker: false,
|
showEventBlocker: false,
|
||||||
previewOpen: localStorage.getItem(PREVIEW_STATE) === "open",
|
previewOpen: localStorage.getItem(PREVIEW_HIDE) === "false",
|
||||||
};
|
};
|
||||||
|
|
||||||
handleSplitPaneDragStart = () => {
|
handleSplitPaneDragStart = () => {
|
||||||
@ -31,10 +31,10 @@ class EntryEditor extends Component {
|
|||||||
|
|
||||||
handleTogglePreview = () => {
|
handleTogglePreview = () => {
|
||||||
const { previewOpen } = this.state;
|
const { previewOpen } = this.state;
|
||||||
const newPreviewState = !previewOpen ? "open" : "closed";
|
const newPreviewState = !previewOpen ? "false" : "true";
|
||||||
this.setState(
|
this.setState(
|
||||||
{ previewOpen: !previewOpen },
|
{ previewOpen: !previewOpen },
|
||||||
localStorage.setItem(PREVIEW_STATE, newPreviewState)
|
localStorage.setItem(PREVIEW_HIDE, newPreviewState)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ class EntryEditor extends Component {
|
|||||||
|
|
||||||
const editor = (
|
const editor = (
|
||||||
<div className={controlClassName}>
|
<div className={controlClassName}>
|
||||||
<Button onClick={this.handleTogglePreview}> TOGGLE PREVIEW </Button>
|
<Button onClick={this.handleTogglePreview}>TOGGLE PREVIEW</Button>
|
||||||
<ControlPane
|
<ControlPane
|
||||||
collection={collection}
|
collection={collection}
|
||||||
entry={entry}
|
entry={entry}
|
||||||
@ -76,7 +76,7 @@ class EntryEditor extends Component {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
const editorWithPreivew = (
|
const editorWithPreview = (
|
||||||
<ScrollSync>
|
<ScrollSync>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<SplitPane
|
<SplitPane
|
||||||
@ -102,7 +102,7 @@ class EntryEditor extends Component {
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<div className={styles.root}>
|
<div className={styles.root}>
|
||||||
{previewOpen === true ? editorWithPreivew : editor}
|
{previewOpen === true ? editorWithPreview : editor}
|
||||||
<div className={styles.footer}>
|
<div className={styles.footer}>
|
||||||
<Toolbar
|
<Toolbar
|
||||||
isPersisting={entry.get('isPersisting')}
|
isPersisting={entry.get('isPersisting')}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user