@@ -11,6 +11,7 @@ import FormGroup from '@material-ui/core/FormGroup';
11
11
import FormControlLabel from '@material-ui/core/FormControlLabel' ;
12
12
import Switch from '@material-ui/core/Switch' ;
13
13
import Input from '@material-ui/core/Input' ;
14
+ import InputAdornment from '@material-ui/core/InputAdornment' ;
14
15
import InputLabel from '@material-ui/core/InputLabel' ;
15
16
import MenuItem from '@material-ui/core/MenuItem' ;
16
17
import FormHelperText from '@material-ui/core/FormHelperText' ;
@@ -33,10 +34,16 @@ const styles = theme => ({
33
34
margin : theme . spacing . unit ,
34
35
minWidth : 120 ,
35
36
} ,
37
+ formControlLabel : {
38
+ margin : theme . spacing . unit * - 0.5 ,
39
+ } ,
36
40
title : {
37
41
display : 'flex' ,
38
42
justifyContent : 'space-between' ,
39
43
} ,
44
+ holdOffInput : {
45
+ width : '7em' ,
46
+ }
40
47
} ) ;
41
48
42
49
class SettingsDialog extends React . Component {
@@ -53,6 +60,10 @@ class SettingsDialog extends React.Component {
53
60
this . props . onFitGraphSwitchChange ( event . target . checked ) ;
54
61
} ;
55
62
63
+ handleHoldOffChange = ( event ) => {
64
+ this . props . onHoldOffChange ( event . target . value ) ;
65
+ } ;
66
+
56
67
render ( ) {
57
68
const { classes } = this . props ;
58
69
return (
@@ -102,6 +113,7 @@ class SettingsDialog extends React.Component {
102
113
</ DialogContentText >
103
114
< FormGroup row >
104
115
< FormControlLabel
116
+ className = { classes . formControlLabel }
105
117
control = {
106
118
< Switch
107
119
checked = { this . props . fitGraph }
@@ -112,6 +124,30 @@ class SettingsDialog extends React.Component {
112
124
/>
113
125
</ FormGroup >
114
126
</ DialogContent >
127
+ < DialogTitle id = "form-dialog-title" > Other</ DialogTitle >
128
+ < DialogContent >
129
+ < FormControl
130
+ className = { classes . formControl }
131
+ aria-describedby = "holdoff-helper-text"
132
+ >
133
+ < InputLabel shrink = { true } > Editor hold-off time</ InputLabel >
134
+ < Input
135
+ className = { classes . holdOffInput }
136
+ id = "holdoff"
137
+ type = "number"
138
+ value = { this . props . holdOff }
139
+ onChange = { this . handleHoldOffChange }
140
+ endAdornment = { < InputAdornment position = "end" > seconds</ InputAdornment > }
141
+ inputProps = { {
142
+ 'aria-label' : 'Holdoff' ,
143
+ min : 0.0 ,
144
+ max : 9.9 ,
145
+ step : 0.1 ,
146
+ } }
147
+ />
148
+ < FormHelperText id = "holdoff-helper-text" > Time of editor inactivity after which graph rendering starts</ FormHelperText >
149
+ </ FormControl >
150
+ </ DialogContent >
115
151
</ Dialog >
116
152
</ div >
117
153
) ;
0 commit comments