tagshow: use flex layout for preview view

This commit is contained in:
Aaron Boodman
2015-09-03 16:26:42 -07:00
parent 718d222c9b
commit 377d08f66f
3 changed files with 22 additions and 17 deletions

View File

@@ -3,10 +3,14 @@
<meta charset="UTF-8">
<script src="tagshow.js"></script>
<style>
body {
html, body, #root {
background: black;
color: white;
margin: 0;
overflow: hidden;
padding: 0;
width: 100%;
height: 100%;
}
</style>
</head>

View File

@@ -24,23 +24,22 @@ var TagChooser = React.createClass({
render: function() {
return (
<table width="100%">
<tr>
<td style={{verticalAlign: 'top'}}>
<form onSubmit={this.handleSubmit}>
<input type="submit" value="OK!"/>
<br/>
<TagList
ds={this.props.ds}
selected={this.props.selectedTags}
onChange={this.props.onChange}/>
</form>
</td>
<td style={{verticalAlign: 'top'}} width="100%">
<form style={{display:'flex', flexDirection:'column', height:'100%'}} onSubmit={this.handleSubmit}>
<div style={{display:'flex', flex:1}}>
<div style={{overflowX:'hidden', overflowY:'auto', marginRight:'1em'}}>
<TagList
ds={this.props.ds}
selected={this.props.selectedTags}
onChange={this.props.onChange}/>
</div>
<div style={{flex:1, overflowX:'hidden', overflowY:'auto', padding:'1em'}}>
<Preview photos={this.props.selectedPhotos}/>
</td>
</tr>
</table>
</div>
</div>
<div style={{textAlign:'center'}}>
<input style={{fontSize:'2em', fontWeight:'bold', margin:'1em', width:'50%'}} type="submit" value="PUSH BUTTON"/>
</div>
</form>
);
},
});

View File

@@ -6,6 +6,8 @@ var React = require('react');
var tagStyle = {
display: 'block',
margin: '3px',
marginRight: '25px',
whiteSpace: 'nowrap',
};