summaryrefslogtreecommitdiffstats
path: root/webapp/stores
diff options
context:
space:
mode:
authorsamogot <samogot@gmail.com>2016-07-14 15:19:27 +0300
committerJoram Wilander <jwawilander@gmail.com>2016-07-14 08:19:27 -0400
commit9b9facd3d21a7ab341dd6d80fd8b53fb852ae036 (patch)
tree11418f04ce57bb6083797c29ceba690b97302e15 /webapp/stores
parent6abc9601bec18e5005ff16dd4147bf038dafb264 (diff)
downloadchat-9b9facd3d21a7ab341dd6d80fd8b53fb852ae036.tar.gz
chat-9b9facd3d21a7ab341dd6d80fd8b53fb852ae036.tar.bz2
chat-9b9facd3d21a7ab341dd6d80fd8b53fb852ae036.zip
PLT-3366 Holding down the ALT key and clicking on a message adds a new messages indicator (squashed) (#3374)
Diffstat (limited to 'webapp/stores')
-rw-r--r--webapp/stores/channel_store.jsx16
1 files changed, 16 insertions, 0 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx
index dc2577811..542fbdf6b 100644
--- a/webapp/stores/channel_store.jsx
+++ b/webapp/stores/channel_store.jsx
@@ -13,6 +13,7 @@ const CHANGE_EVENT = 'change';
const LEAVE_EVENT = 'leave';
const MORE_CHANGE_EVENT = 'change';
const EXTRA_INFO_EVENT = 'extra_info';
+const LAST_VIEVED_EVENT = 'last_viewed';
class ChannelStoreClass extends EventEmitter {
constructor(props) {
@@ -32,6 +33,9 @@ class ChannelStoreClass extends EventEmitter {
this.emitLeave = this.emitLeave.bind(this);
this.addLeaveListener = this.addLeaveListener.bind(this);
this.removeLeaveListener = this.removeLeaveListener.bind(this);
+ this.emitLastViewed = this.emitLastViewed.bind(this);
+ this.addLastViewedListener = this.addLastViewedListener.bind(this);
+ this.removeLastViewedListener = this.removeLastViewedListener.bind(this);
this.findFirstBy = this.findFirstBy.bind(this);
this.get = this.get.bind(this);
this.getMember = this.getMember.bind(this);
@@ -109,6 +113,18 @@ class ChannelStoreClass extends EventEmitter {
this.removeListener(LEAVE_EVENT, callback);
}
+ emitLastViewed(lastViewed, ownNewMessage) {
+ this.emit(LAST_VIEVED_EVENT, lastViewed, ownNewMessage);
+ }
+
+ addLastViewedListener(callback) {
+ this.on(LAST_VIEVED_EVENT, callback);
+ }
+
+ removeLastViewedListener(callback) {
+ this.removeListener(LAST_VIEVED_EVENT, callback);
+ }
+
findFirstBy(field, value) {
return this.doFindFirst(field, value, this.getChannels());
}