From 3b8cd1ef22598680a590280a3cfbb2efb2dcaa4a Mon Sep 17 00:00:00 2001 From: Nate Wang Date: Thu, 14 Jun 2018 17:30:31 +0800 Subject: [PATCH] Persist editor sider split position. --- .../src/features/editor/EditorSider.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/rekit-studio/src/features/editor/EditorSider.js b/packages/rekit-studio/src/features/editor/EditorSider.js index 5375a254..336f3f52 100644 --- a/packages/rekit-studio/src/features/editor/EditorSider.js +++ b/packages/rekit-studio/src/features/editor/EditorSider.js @@ -4,6 +4,7 @@ import SplitPane from 'react-split-pane'; import Pane from 'react-split-pane/lib/Pane'; import { Button, Icon } from 'antd'; import history from '../../common/history'; +import { storage } from '../common/utils'; import { OutlineView, DepsView } from './'; export default class EditorSider extends Component { @@ -15,17 +16,22 @@ export default class EditorSider extends Component { showDepsView: PropTypes.bool.isRequired, }; + handleResizeEnd = (sizes) => { + storage.local.setItem('editorSiderSizes', sizes); + } + render() { const { width, code, onSelectNode } = this.props; + const sizes = storage.local.getItem('editorSiderSizes') || []; const panes = [ - +
Outline
, ]; if (this.props.showDepsView) { panes.push( - +
Relations