From ea4250bbbc21492a7f114daca30d839bc7644e90 Mon Sep 17 00:00:00 2001
From: nickago <ngonella@calpoly.edu>
Date: Fri, 31 Jul 2015 16:45:14 -0700
Subject: Added comments to confusing post list method

---
 web/react/components/post_list.jsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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

diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 83f806b79..e7d57df8d 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -29,12 +29,15 @@ function getStateFromStores() {
 module.exports = React.createClass({
     displayName: "PostList",
     scrollPosition: 0,
-    preventScrollTrigger: false,
+    preventScrollTrigger: false,   // Can't think of an intuitive name, but when true,
+                                   // scrollPosition is affected by the 'on scroll' event below
     gotMorePosts: false,
     oldScrollHeight: 0,
     oldZoom: 0,
     scrolledToNew: false,
     componentDidMount: function() {
+
+        // Add CSS required to have the theme colors
         var user = UserStore.getCurrentUser();
         if (user.props && user.props.theme) {
             utils.changeCss('div.theme', 'background-color:'+user.props.theme+';');
@@ -55,11 +58,13 @@ module.exports = React.createClass({
             $('.team__header').addClass('theme--gray');
         }
 
+        // Start our Store listeners
         PostStore.addChangeListener(this._onChange);
         ChannelStore.addChangeListener(this._onChange);
         UserStore.addStatusesChangeListener(this._onTimeChange);
         SocketStore.addChangeListener(this._onSocketChange);
 
+        // Initialize perfect scrollbar
         $(".post-list-holder-by-time").perfectScrollbar();
 
         this.resize();
@@ -69,6 +74,8 @@ module.exports = React.createClass({
         this.oldScrollHeight = post_holder.scrollHeight;
         this.oldZoom = (window.outerWidth - 8) / window.innerWidth;
 
+        /*************** End of 'run on mount' code, Start of event listeners *****************/
+
         var self = this;
         $(window).resize(function(){
             $(post_holder).perfectScrollbar('update');
-- 
cgit v1.2.3-1-g7c22

