Merge pull request #223 from aboodman/and

tagshow: more refinements
This commit is contained in:
Aaron Boodman
2015-08-25 21:56:23 -07:00
2 changed files with 17 additions and 2 deletions
+13 -2
View File
@@ -36,7 +36,7 @@ var SlideShow = React.createClass({
.valueSeq()
.map(ref => ref.deref()))
}).then(sets => {
this.setState({photos: Immutable.Set().union(...sets)})
this.setState({photos: Immutable.Set(sets[0]).intersect(...sets)})
});
return <div style={containerStyle}>{
@@ -64,6 +64,7 @@ var Item = React.createClass({
getInitialState: function() {
return {
blob: null,
tags: Immutable.Set(),
};
},
@@ -72,11 +73,21 @@ var Item = React.createClass({
p => p.get('image').deref()).then(
b => this.setState({blob: b}));
this.props.photoRef.deref().then(
p => p.get('tags').deref()).then(
tags => this.setState({tags: tags}));
if (this.state.blob == null) {
return <span>loading...</span>;
}
return <img style={imageStyle} src={URL.createObjectURL(this.state.blob)}/>
return (
<div style={{display:'inline-block'}}>
<img style={imageStyle} src={URL.createObjectURL(this.state.blob)}/>
<br/>
{this.state.tags.toArray().join(', ')}
</div>
);
},
});
+4
View File
@@ -20,6 +20,10 @@ class Ref{
return this._promise;
}
valueOf() {
return this.ref;
}
// BUG 88 (instance of is failing in dev build)
static isRef(ref) {
return ref && ref._isRef === isRef;