improvement(editor): persist editor split pane position (#2304)
This commit is contained in:
parent
a1eaf3e48a
commit
29f12c94d9
@ -13,6 +13,7 @@ import EditorToggle from './EditorToggle';
|
|||||||
|
|
||||||
const PREVIEW_VISIBLE = 'cms.preview-visible';
|
const PREVIEW_VISIBLE = 'cms.preview-visible';
|
||||||
const SCROLL_SYNC_ENABLED = 'cms.scroll-sync-enabled';
|
const SCROLL_SYNC_ENABLED = 'cms.scroll-sync-enabled';
|
||||||
|
const SPLIT_PANE_POSITION = 'cms.split-pane-position';
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
splitPane: css`
|
splitPane: css`
|
||||||
@ -199,7 +200,8 @@ class EditorInterface extends Component {
|
|||||||
<ReactSplitPaneGlobalStyles />
|
<ReactSplitPaneGlobalStyles />
|
||||||
<StyledSplitPane
|
<StyledSplitPane
|
||||||
maxSize={-100}
|
maxSize={-100}
|
||||||
defaultSize="50%"
|
defaultSize={parseInt(localStorage.getItem(SPLIT_PANE_POSITION), 10) || '50%'}
|
||||||
|
onChange={size => localStorage.setItem(SPLIT_PANE_POSITION, size)}
|
||||||
onDragStarted={this.handleSplitPaneDragStart}
|
onDragStarted={this.handleSplitPaneDragStart}
|
||||||
onDragFinished={this.handleSplitPaneDragFinished}
|
onDragFinished={this.handleSplitPaneDragFinished}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user