-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flux - 31 - Actions With Multiple Methods
- Loading branch information
1 parent
95af337
commit 43e3865
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.image-detail { | ||
.panel-body { | ||
text-align: center; | ||
} | ||
|
||
img, video { | ||
max-width: 100%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var Reflux = require('reflux'); | ||
var Actions = require('../actions'); | ||
var Api = require('../utils/api'); | ||
|
||
module.exports = Reflux.createStore({ | ||
listenables: [Actions], | ||
getImage: function(id){ | ||
Api.get('gallery/' + id + '/comments') | ||
.then(function(json){ | ||
this.comment = json.data; | ||
this.triggerChange(); | ||
}.bind(this)); | ||
}, | ||
triggerChange: function() { | ||
this.trigger('change', this.comment); | ||
} | ||
}); |