summaryrefslogtreecommitdiffstats
path: root/web/react/stores/post_store.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-10-30 14:29:15 -0400
committerChristopher Speller <crspeller@gmail.com>2015-11-02 08:16:57 -0500
commitb9a3ff74dd2b299ae4980922a6dcc55002662517 (patch)
tree882abf9d49107d604f7c94e5739d63c84d742315 /web/react/stores/post_store.jsx
parented68f2e9015f3ac94ef1d5f7bf2941611625c60d (diff)
downloadchat-b9a3ff74dd2b299ae4980922a6dcc55002662517.tar.gz
chat-b9a3ff74dd2b299ae4980922a6dcc55002662517.tar.bz2
chat-b9a3ff74dd2b299ae4980922a6dcc55002662517.zip
Hooking up external components
Diffstat (limited to 'web/react/stores/post_store.jsx')
-rw-r--r--web/react/stores/post_store.jsx29
1 files changed, 29 insertions, 0 deletions
diff --git a/web/react/stores/post_store.jsx b/web/react/stores/post_store.jsx
index 8f4e30e7c..19b200ac8 100644
--- a/web/react/stores/post_store.jsx
+++ b/web/react/stores/post_store.jsx
@@ -14,6 +14,7 @@ var ActionTypes = Constants.ActionTypes;
var CHANGE_EVENT = 'change';
var SELECTED_POST_CHANGE_EVENT = 'selected_post_change';
var EDIT_POST_EVENT = 'edit_post';
+var POST_LIST_JUMP_EVENT = 'post_list_jump';
class PostStoreClass extends EventEmitter {
constructor() {
@@ -31,6 +32,10 @@ class PostStoreClass extends EventEmitter {
this.addEditPostListener = this.addEditPostListener.bind(this);
this.removeEditPostListener = this.removeEditPostListener.bind(this);
+ this.emitPostListJump = this.emitPostListJump.bind(this);
+ this.addPostListJumpListener = this.addPostListJumpListener.bind(this);
+ this.removePostListJumpListener = this.removePostListJumpListener.bind(this);
+
this.getCurrentPosts = this.getCurrentPosts.bind(this);
this.storePosts = this.storePosts.bind(this);
this.pStorePosts = this.pStorePosts.bind(this);
@@ -100,6 +105,30 @@ class PostStoreClass extends EventEmitter {
this.removeListener(EDIT_POST_EVENT, callback);
}
+ emitPostListJump(type, post) {
+ this.emit(POST_LIST_JUMP_EVENT, type, post);
+ }
+
+ addPostListJumpListener(callback) {
+ this.on(POST_LIST_JUMP_EVENT, callback);
+ }
+
+ removePostListJumpListener(callback) {
+ this.removeListener(POST_LIST_JUMP_EVENT, callback);
+ }
+
+ jumpPostListBottom() {
+ this.emitPostListJump(Constants.PostListJumpTypes.BOTTOM, null);
+ }
+
+ jumpPostListToPost(post) {
+ this.emitPostListJump(Constants.PostListJumpTypes.POST, post);
+ }
+
+ jumpPostListSidebarOpen() {
+ this.emitPostListJump(Constants.PostListJumpTypes.SIDEBAR_OPEN, null);
+ }
+
getCurrentPosts() {
var currentId = ChannelStore.getCurrentId();