Ignore:
Timestamp:
06/27/20 17:57:53 (4 years ago)
Author:
Maciej Komosinski
Message:

Improved layout, added one free-text question, properly counted the number of Parts in the Model instead of counting 'X' in the genotype

File:
1 edited

Legend:

Unmodified
Added
Removed
  • js/human_3d_alignment/src/widgets/sliderviewer.jsx

    r911 r964  
    4242        width: '80%'
    4343    },
     44    textArea: {
     45        display: 'table',
     46    marginLeft: 'auto',
     47    marginRight: 'auto'
     48    },
    4449    nextButton: {
    4550        width: '250px',
     
    7681        this.props = props;
    7782        this.state = {
    78             percent: 50
     83            percent: 50,
     84            textValue: ''
    7985        }
    8086
    8187        this.handleChangePercent = this.handleChangePercent.bind(this);
     88        this.handleChangeText = this.handleChangeText.bind(this);
    8289        this.onClickNext = this.onClickNext.bind(this);
    8390    }
     
    8895     */
    8996    handleChangePercent(per) {
    90                 this.setState({ percent: per.x }, function() {
     97        this.setState({ percent: per.x }, function() {
    9198            console.log(this.state.percent);
    9299            this.props.handleChangePercent(this.state.percent);
     100        });
     101    }
     102   
     103    handleChangeText(text_) {
     104        this.setState({ textValue: text_.target.value }, function() {
     105            this.props.handleChangeText(this.state.textValue);
    93106        });
    94107    }
     
    103116                console.log(this.state.percent);
    104117                this.props.handleChangePercent(this.state.percent);
     118            });
     119            this.setState({ textValue: '' }, function() {
     120                console.log(this.state.percent);
     121                this.props.handleChangeText(this.state.textValue);
    105122            });
    106123        } else {
     
    146163                    </button>
    147164                </div>
    148                 <div style={styles.small_interval}/>
     165                <div style={styles.interval}/>
     166               
     167                <div className="text">
     168                <textarea value={this.state.textValue} onChange={this.handleChangeText} cols={75} rows={1} style={styles.textArea} placeholder={'Napisz krótko dlaczego dokonałaś/eś akurat takiego dopasowania'}/>
     169                </div>
     170                {/*
    149171                <div style={styles.finishButton_position}>
    150172                    <button type='button' onClick={this.props.onClickFinish} style={styles.finishButton}>
     
    152174                    </button>
    153175                </div>
     176                */}
    154177               
    155178            </div>
Note: See TracChangeset for help on using the changeset viewer.