From 72e5d441ff471d75effe52b4ef0eafe0667aa54e Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Fri, 7 Aug 2015 10:58:03 -0400
Subject: Added handlers for the sidebar to update unread message indicators on
 page resize

---
 web/react/components/sidebar.jsx | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'web/react/components/sidebar.jsx')

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());
 
-- 
cgit v1.2.3-1-g7c22

