From 602bcc4f3881faefeca65c6b8f66db2cff64e152 Mon Sep 17 00:00:00 2001 From: nickago Date: Fri, 14 Aug 2015 13:36:10 -0700 Subject: Moved controlling CSS into post list so it always shows up --- web/react/components/post.jsx | 6 ------ web/react/components/post_list.jsx | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'web/react/components') diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx index e72a2d001..f099c67ab 100644 --- a/web/react/components/post.jsx +++ b/web/react/components/post.jsx @@ -11,12 +11,6 @@ var ActionTypes = Constants.ActionTypes; module.exports = React.createClass({ displayName: "Post", - componentDidMount: function() { - $('.modal').on('show.bs.modal', function () { - $('.modal-body').css('overflow-y', 'auto'); - $('.modal-body').css('max-height', $(window).height() * 0.7); - }); - }, handleCommentClick: function(e) { e.preventDefault(); diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index 83f806b79..fa74d4295 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -69,6 +69,12 @@ module.exports = React.createClass({ this.oldScrollHeight = post_holder.scrollHeight; this.oldZoom = (window.outerWidth - 8) / window.innerWidth; + $('.modal').on('show.bs.modal', function () { + $('.modal-body').css('overflow-y', 'auto'); + $('.modal-body').css('max-height', $(window).height() * 0.7); + }); + + // Timeout exists for the DOM to fully render before making changes var self = this; $(window).resize(function(){ $(post_holder).perfectScrollbar('update'); @@ -140,6 +146,7 @@ module.exports = React.createClass({ UserStore.removeStatusesChangeListener(this._onTimeChange); SocketStore.removeChangeListener(this._onSocketChange); $('body').off('click.userpopover'); + $('.modal').off('show.bs.modal') }, resize: function() { var post_holder = $(".post-list-holder-by-time")[0]; -- cgit v1.2.3-1-g7c22