Disable configure while mounting/unmounting

This commit is contained in:
Scott E. Graves
2019-06-05 17:49:46 -05:00
parent 59c4e37f74
commit 6056e2d063

View File

@@ -19,14 +19,15 @@ export default connect(mapStateToProps)(props => {
let configButton = null;
let secondRow = 6;
if (props.allowConfig) {
const pointer = {cursor: props.allowMount ? 'pointer' : 'no-drop'};
configButton = (
<RootElem colSpan={4}
rowSpan={6}>
<img alt=''
height={'16px'}
onClick={props.disabled ? (e)=>{e.preventDefault();} : props.configClicked}
onClick={props.allowMount ? props.configClicked : (e)=>{e.preventDefault();}}
src={configureImage}
style={{padding: 0, border: 0, margin: 0, cursor: 'pointer'}}
style={{padding: 0, border: 0, margin: 0, ...pointer}}
width={'16px'}/>
</RootElem>
);
@@ -38,7 +39,7 @@ export default connect(mapStateToProps)(props => {
inputColumnSpan = 20;
inputControls = <DropDown changed={props.changed}
colSpan={inputColumnSpan}
disabled={!props.allowMount || props.mounted || props.disabled}
disabled={!props.allowMount || props.mounted}
items={props.items}
row={secondRow}
rowSpan={7}
@@ -53,7 +54,7 @@ export default connect(mapStateToProps)(props => {
key={'i' + key++}
row={secondRow}
rowSpan={7}>
<input disabled={!props.allowMount || props.mounted || props.disabled}
<input disabled={!props.allowMount || props.mounted}
maxLength={4096}
onChange={props.changed}
size={4096}
@@ -66,14 +67,14 @@ export default connect(mapStateToProps)(props => {
<Button clicked={()=>props.browseClicked(props.title, props.location)}
col={inputColumnSpan - 7}
colSpan={7}
disabled={props.mounted || props.disabled || !props.allowMount}
disabled={props.mounted || !props.allowMount}
key={'b' + key++}
row={secondRow}
rowSpan={7}>...</Button>
));
}
const buttonDisplay = props.allowMount || props.disabled ?
const buttonDisplay = props.allowMount ?
(props.mounted ? 'Unmount' : 'Mount') :
<Loader color={'var(--heading_text_color)'}
height='19px'
@@ -84,7 +85,7 @@ export default connect(mapStateToProps)(props => {
<Button clicked={()=>props.clicked(props.title, !props.mounted, props.location)}
col={inputColumnSpan + 2}
colSpan={21}
disabled={!props.allowMount || props.disabled}
disabled={!props.allowMount}
row={secondRow}
rowSpan={7}>
{buttonDisplay}
@@ -96,7 +97,6 @@ export default connect(mapStateToProps)(props => {
row={secondRow}
rowSpan={7}>
<input checked={props.autoMount}
disabled={props.disabled}
onChange={props.autoMountChanged}
type='checkbox'/>Auto-mount
</RootElem>
@@ -108,7 +108,6 @@ export default connect(mapStateToProps)(props => {
row={secondRow}
rowSpan={7}>
<input checked={props.autoRestart}
disabled={props.disabled}
onChange={props.autoRestartChanged}
type='checkbox'/>Restart
</RootElem>