homepage mobile experience became bearable by using questionable css and js practices

This commit is contained in:
Senad Uka
2015-06-20 07:05:16 +02:00
parent 7d74a3cc27
commit f05b307fc0
6 changed files with 128 additions and 31 deletions

View File

@@ -40,7 +40,7 @@ var SearchBox = React.createClass({
}
},
render: function() {
return (<form style={ {marginLeft: '60px', width: '100%'} } className="form-inline">
var large = (<form style={ {marginLeft: '60px', width: '100%'} } className="form-inline">
<div className="left-inner-addon">
<i className="glyphicon glyphicon-search"></i>
<input style={{width: '75%'}} type="search" onKeyPress={this.onKeyPress}
@@ -54,8 +54,28 @@ var SearchBox = React.createClass({
onClick={this.onSearchClick}>Traži</button>
</div>
</form>)
</form>);
var small = (<form className="form-inline">
<span className="left-inner-addon">
<i style={{positon: "absolute", zIndex: "600" }} className="glyphicon glyphicon-search"></i>
<input style={{ width: "100%"}} type="search" onKeyPress={this.onKeyPress}
className="search-box form-control"
value={this.state.q} onChange={this.onSearchBoxChange}
aria-hidden="true">
</input>
</span>
</form>);
if (this.props.small === 'true') {
return small;
}
else {
return large;
}
}
});
}
);
module.exports = SearchBox;