Skip to content

Commit

Permalink
don't show midi selector if midi is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
philippotto committed Oct 29, 2017
1 parent e275160 commit 3c09d17
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions app/scripts/views/pitch_settings_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,26 @@ export default class PitchSettingsView extends Component {
/>
<label htmlFor="try_to_use_midi_checkbox" />
</SettingLine>
<SettingLine label="Midi device">
<select
name="select"
onChange={this.onMidiSelectChange.bind(this)}
defaultValue={midiSettings.currentInput}
ref={c => {
this.midiSelect = c;
}}
disabled={!tryToUseMidi}
>
{midiInputs.map((el, index) => {
return (
<option value={index} key={index}>
Device {index + 1}
</option>
);
})}
</select>
</SettingLine>
{tryToUseMidi ? (
<SettingLine label="Midi device">
<select
name="select"
onChange={this.onMidiSelectChange.bind(this)}
defaultValue={midiSettings.currentInput}
ref={c => {
this.midiSelect = c;
}}
>
{midiInputs.map((el, index) => {
return (
<option value={index} key={index}>
Device {index + 1}
</option>
);
})}
</select>
</SettingLine>
) : null}
</div>
);

Expand Down

0 comments on commit 3c09d17

Please sign in to comment.