提交 88238c91 编写于 作者: V vlin17 提交者: Jiangtao Hu

cleanup

上级 f1c80ee8
......@@ -33,7 +33,7 @@ export default class RouteEditingMenu extends React.Component {
<RouteEditingButton label="Add Point of Interest"
icon={addPoiIcon}
onClick={() => {
this.props.store.handleSideBarClick('showPOI');
this.props.store.handleOptionToggle('showPOI');
}}/>
<RouteEditingButton label="Remove Last Point"
icon={removeLastIcon}
......
......@@ -14,30 +14,30 @@ export default class SideBar extends React.Component {
<div className="side-bar">
<ButtonPanel enableHMIButtonsOnly={enableHMIButtonsOnly}
onTasks={() => {
this.props.store.handleSideBarClick('showTasks');
this.props.store.handleOptionToggle('showTasks');
}}
showTasks={options.showTasks}
onModuleController={() => {
this.props.store.handleSideBarClick('showModuleController');
this.props.store.handleOptionToggle('showModuleController');
}}
showModuleController={options.showModuleController}
onMenu={() => {
this.props.store.handleSideBarClick('showMenu');
this.props.store.handleOptionToggle('showMenu');
}}
showMenu={options.showMenu}
onRouteEditingBar={() => {
this.props.store.handleSideBarClick('showRouteEditingBar');
this.props.store.handleOptionToggle('showRouteEditingBar');
}}
showRouteEditingBar={options.showRouteEditingBar}
onDataRecorder={() => {
this.props.store.handleSideBarClick('showDataRecorder');
this.props.store.handleOptionToggle('showDataRecorder');
}}
showDataRecorder={options.showDataRecorder} />
<SubButtonPanel enablePOI={
!enableHMIButtonsOnly && !options.showRouteEditingBar
}
onPOI={() => {
this.props.store.handleSideBarClick('showPOI');
this.props.store.handleOptionToggle('showPOI');
}}
showPOI={!options.showRouteEditingBar && options.showPOI} />
</div>
......
......@@ -29,14 +29,14 @@ export default class Others extends React.Component {
isChecked={options.showVideo}
disabled={disablePanel}
onClick={() => {
options.toggleSideBar("showVideo");
this.props.store.handleOptionToggle('showVideo');
}}/>
<CheckboxItem id={"showPNCMonitor"}
title={"PNC Monitor"}
isChecked={options.showPNCMonitor}
disabled={disablePanel}
onClick={() => {
this.props.store.handleSideBarClick('showPNCMonitor');
this.props.store.handleOptionToggle('showPNCMonitor');
}}/>
<CheckboxItem id={"panelLock"}
title={"Lock Task Panel"}
......@@ -49,7 +49,7 @@ export default class Others extends React.Component {
disabled={false}
onClick={() => {
WS.toggleSimControl(!options.simControlEnabled);
options.toggleSideBar("simControlEnabled");
this.props.store.handleOptionToggle('simControlEnabled');
}}/>
</div>
</div>
......
......@@ -108,11 +108,11 @@ class DreamviewStore {
}
}
handleSideBarClick(option) {
handleOptionToggle(option) {
const oldShowPNCMonitor = this.options.showPNCMonitor;
const oldShowRouteEditingBar = this.options.showRouteEditingBar;
this.options.toggleSideBar(option);
this.options.toggle(option);
// disable tools turned off after toggling
if (oldShowPNCMonitor && !this.options.showPNCMonitor) {
......
......@@ -71,7 +71,7 @@ export default class Options {
this.cameraAngle === 'Monitor';
}
@action toggleSideBar(option) {
@action toggle(option) {
this[option] = !this[option];
// Disable other mutually exclusive options
......@@ -90,10 +90,6 @@ export default class Options {
}
}
@action toggle(option) {
this[option] = !this[option];
}
@action selectCamera(option) {
this.cameraAngle = option;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册