Fixing Gallery bug

This commit is contained in:
ajmaley 2018-12-05 17:31:40 -05:00
parent c76d1fbeb6
commit 58a87bdda0
2 changed files with 33 additions and 5 deletions

View File

@ -16,14 +16,28 @@ const styles = theme => ({
}, },
flamelinkGallery: { flamelinkGallery: {
marginRight: "auto", marginRight: 'auto',
marginLeft: "auto", marginLeft: 'auto',
backgroundImage: 'url(../images/galleryBackgroundImage.png)',
overflow: 'hidden',
minHeight: 300,
minWidth: 300,
width: 'auto',
height: 'auto',
}, },
flamelinkGalleryContainer: { flamelinkGalleryContainer: {
backgroundColor: 'black', backgroundColor: 'black',
marginTop: 20, marginTop: 20,
}, },
flamelinkGalleryInnerContainer: {
maxHeight: 1000,
minHeight: 250,
height: 'auto',
width: 'auto',
marginRight: 'auto',
marginLeft: 'auto',
},
}); });
class FlameLinkCollectionGallery extends Component { class FlameLinkCollectionGallery extends Component {
@ -44,6 +58,10 @@ class FlameLinkCollectionGallery extends Component {
} }
} }
state = {
active: false,
}
constructor(props) { constructor(props) {
super(props); super(props);
@ -51,7 +69,7 @@ class FlameLinkCollectionGallery extends Component {
schemaDetails: '', schemaDetails: '',
schemaContent: '', schemaContent: '',
schemaDescription: '', schemaDescription: '',
} };
flamelinkApp.schemas.getFields(this.props.galleryName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] }) flamelinkApp.schemas.getFields(this.props.galleryName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] })
.then(result => this.setState({ .then(result => this.setState({
@ -74,6 +92,10 @@ class FlameLinkCollectionGallery extends Component {
this.getPageTitle(this.props.galleryName); this.getPageTitle(this.props.galleryName);
} }
toggleClass = () => {
this.setState(state => ({ active: !state.active }));
}
getGalleryInfo(schemaDetails, schemaContent) { getGalleryInfo(schemaDetails, schemaContent) {
var key; var key;
var mediaNums = []; var mediaNums = [];
@ -111,8 +133,12 @@ class FlameLinkCollectionGallery extends Component {
{this.state.schemaDescription} {this.state.schemaDescription}
</Typography> </Typography>
<Grid container className={classes.flamelinkGalleryContainer}> <Grid container className={classes.flamelinkGalleryContainer}>
<Grid item lg={8} md={8} sm={12} xs={12} className={classes.flamelinkGallery} > <Grid container className={classes.flamelinkGalleryInnerContainer}>
<Grid item lg={8} md={8} sm={12} xs={12} className={classes.flamelinkGallery} onClick={this.toggleClass}>
<div onClick={this.toggleClass}>
<RenderGallery key={Math.random()} /> <RenderGallery key={Math.random()} />
</div>
</Grid>
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>

View File

@ -12,6 +12,7 @@ class RenderGallery extends Component {
showIndex: true, showIndex: true,
showBullets: true, showBullets: true,
mounted: false, mounted: false,
autoPlay: true,
} }
} }
@ -31,6 +32,7 @@ class RenderGallery extends Component {
showIndex={this.state.showIndex} showIndex={this.state.showIndex}
showBullets={this.state.showBullets} showBullets={this.state.showBullets}
onImageLoad={this._onImageLoad} onImageLoad={this._onImageLoad}
autoPlay={this.state.autoPlay}
/> />
); );
} }