summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-08-07 10:58:03 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-08-07 10:58:03 -0400
commit72e5d441ff471d75effe52b4ef0eafe0667aa54e (patch)
tree7979bb5e1df1e5c36e17d1228ca93889a610440f /web
parent5b831e78a79dba6f8dbea91c0cc2ba0b9253eb15 (diff)
downloadchat-72e5d441ff471d75effe52b4ef0eafe0667aa54e.tar.gz
chat-72e5d441ff471d75effe52b4ef0eafe0667aa54e.tar.bz2
chat-72e5d441ff471d75effe52b4ef0eafe0667aa54e.zip
Added handlers for the sidebar to update unread message indicators on page resize
Diffstat (limited to 'web')
-rw-r--r--web/react/components/sidebar.jsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index 5ce9e5d02..fe73cbcf7 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -133,12 +133,16 @@ module.exports = React.createClass({
this.updateTitle();
this.updateUnreadIndicators();
+
+ $(window).on('resize', this.onResize);
},
componentDidUpdate: function() {
this.updateTitle();
this.updateUnreadIndicators();
},
componentWillUnmount: function() {
+ $(window).off('resize', this.onResize);
+
ChannelStore.removeChangeListener(this.onChange);
UserStore.removeChangeListener(this.onChange);
UserStore.removeStatusesChangeListener(this.onChange);
@@ -246,6 +250,9 @@ module.exports = React.createClass({
onScroll: function(e) {
this.updateUnreadIndicators();
},
+ onResize: function(e) {
+ this.updateUnreadIndicators();
+ },
updateUnreadIndicators: function() {
var container = $(this.refs.container.getDOMNode());