Skip to content

Commit

Permalink
Merge pull request #136 from Exabyte-io/hotfix/dropdown-fix
Browse files Browse the repository at this point in the history
chore: keep dropdown open on click
  • Loading branch information
timurbazhirov committed Sep 14, 2023
2 parents d97ad59 + a1debf7 commit e0a4a94
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/ThreeDEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export class ThreeDEditor extends React.Component {

handleToggleLabels() {
this.WaveComponent.wave.toggleLabels();
this._resetStateWaveComponent();
}

handleChemicalConnectivityFactorChange(e) {
Expand Down Expand Up @@ -442,6 +443,7 @@ export class ThreeDEditor extends React.Component {
leftIcon: <ThreeDRotation />,
rightIcon: this.getCheckmark(this._getWaveProperty("areOrbitControlsEnabled")),
onClick: this.handleToggleOrbitControls,
shouldMenuStayOpened: true,
},
{
id: "auto-rotate",
Expand All @@ -452,6 +454,7 @@ export class ThreeDEditor extends React.Component {
this._getWaveProperty("isOrbitControlsAnimationEnabled"),
),
onClick: this.handleToggleOrbitControlsAnimation,
shouldMenuStayOpened: true,
},
{
id: "toggle-axes",
Expand All @@ -460,6 +463,7 @@ export class ThreeDEditor extends React.Component {
leftIcon: <GpsFixed />,
rightIcon: this.getCheckmark(this._getWaveProperty("areAxesEnabled")),
onClick: this.handleToggleAxes,
shouldMenuStayOpened: true,
},
{
id: "toggle-camera",
Expand All @@ -468,6 +472,7 @@ export class ThreeDEditor extends React.Component {
leftIcon: <SwitchCamera />,
rightIcon: this.getCheckmark(this._getWaveProperty("isCameraOrthographic")),
onClick: this.handleToggleOrthographicCamera,
shouldMenuStayOpened: true,
},
{
id: "toggle-bonds",
Expand All @@ -476,6 +481,7 @@ export class ThreeDEditor extends React.Component {
leftIcon: <Dehaze />,
rightIcon: this.getCheckmark(this._getWaveProperty("isDrawBondsEnabled")),
onClick: this.handleToggleBonds,
shouldMenuStayOpened: true,
},
{
id: "toggle-cell",
Expand All @@ -484,6 +490,7 @@ export class ThreeDEditor extends React.Component {
leftIcon: <FormatShapes />,
rightIcon: this.getCheckmark(isConventionalCellShown),
onClick: this.handleToggleConventionalCell,
shouldMenuStayOpened: true,
},
{
id: "toggle-labels",
Expand All @@ -492,6 +499,7 @@ export class ThreeDEditor extends React.Component {
leftIcon: <Spellcheck />,
rightIcon: this.getCheckmark(this._getWaveProperty("areLabelsShown")),
onClick: this.handleToggleLabels,
shouldMenuStayOpened: true,
},
{
id: "toggle-view-adjustment",
Expand All @@ -500,6 +508,7 @@ export class ThreeDEditor extends React.Component {
leftIcon: <ControlCameraRounded />,
rightIcon: this.getCheckmark(viewerSettings.isViewAdjustable),
onClick: this.handleToggleIsViewAdjustable,
shouldMenuStayOpened: true,
},
{
id: "divider-2",
Expand All @@ -511,6 +520,7 @@ export class ThreeDEditor extends React.Component {
content: "Reset View [R]",
leftIcon: <Replay />,
onClick: this.handleResetViewer,
shouldMenuStayOpened: true,
},
];
};
Expand All @@ -525,19 +535,22 @@ export class ThreeDEditor extends React.Component {
rightIcon: this.getCheckmark(isDistanceShown),
leftIcon: <HeightIcon />,
onClick: this.handleToggleDistanceShown,
shouldMenuStayOpened: true,
},
{
id: "Angles",
content: "Angles [A]",
rightIcon: this.getCheckmark(isAnglesShown),
leftIcon: <LooksIcon />,
onClick: this.handleToggleAnglesShown,
shouldMenuStayOpened: true,
},
{
id: "Delete",
content: "Delete connection [X]",
leftIcon: <DeleteIcon />,
onClick: this.handleDeleteConnection,
shouldMenuStayOpened: true,
},
{
id: "divider-actions",
Expand All @@ -548,6 +561,7 @@ export class ThreeDEditor extends React.Component {
content: "Reset Measures",
leftIcon: <Replay />,
onClick: this.handleResetMeasures,
shouldMenuStayOpened: true,
},
];
};
Expand Down Expand Up @@ -614,7 +628,6 @@ export class ThreeDEditor extends React.Component {
id: "Parameters",
title: "Parameters",
header: "Parameters",
shouldMenuStayOpened: true,
leftIcon: <Settings />,
contentObject: this.getParametersActions(),
onClick: () => this.handleToggleToolbarMenu("parameters"),
Expand Down

0 comments on commit e0a4a94

Please sign in to comment.