summaryrefslogtreecommitdiffstats
path: root/web/react/stores/post_store.jsx
diff options
context:
space:
mode:
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();