File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1+ .image-detail {
2+ .panel-body {
3+ text-align : center ;
4+ }
5+
6+ img , video {
7+ max-width : 100% ;
8+ }
9+ }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ module.exports = React.createClass({
1616 Actions . getImage ( this . props . params . id ) ;
1717 } ,
1818 render : function ( ) {
19- return < div >
19+ return < div className = "image-detail" >
2020 { this . state . image ? this . renderContent ( ) : null }
2121 </ div >
2222 } ,
Original file line number Diff line number Diff line change 1+ var Reflux = require ( 'reflux' ) ;
2+ var Actions = require ( '../actions' ) ;
3+ var Api = require ( '../utils/api' ) ;
4+
5+ module . exports = Reflux . createStore ( {
6+ listenables : [ Actions ] ,
7+ getImage : function ( id ) {
8+ Api . get ( 'gallery/' + id + '/comments' )
9+ . then ( function ( json ) {
10+ this . comment = json . data ;
11+ this . triggerChange ( ) ;
12+ } . bind ( this ) ) ;
13+ } ,
14+ triggerChange : function ( ) {
15+ this . trigger ( 'change' , this . comment ) ;
16+ }
17+ } ) ;
You can’t perform that action at this time.
0 commit comments