From 44fa72066bacb741c3303633b6a3a690f6fc0d01 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Mon, 15 Feb 2016 23:23:07 +0500 Subject: Other minor improvements --- web/react/components/post_info.jsx | 9 +++++++++ web/sass-files/sass/partials/_post.scss | 4 ++-- web/sass-files/sass/partials/_post_right.scss | 15 ++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) (limited to 'web') diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx index c44223b1f..d1d516816 100644 --- a/web/react/components/post_info.jsx +++ b/web/react/components/post_info.jsx @@ -14,9 +14,17 @@ export default class PostInfo extends React.Component { constructor(props) { super(props); + this.dropdownPosition = this.dropdownPosition.bind(this); this.handlePermalink = this.handlePermalink.bind(this); this.removePost = this.removePost.bind(this); } + dropdownPosition(e) { + var position = $('#post-list').height() - $(e.target).offset().top; + var dropdown = $(e.target).next('.dropdown-menu'); + if (position < dropdown.height()) { + dropdown.addClass('bottom'); + } + } createDropdown() { var post = this.props.post; var isOwner = UserStore.getCurrentId() === post.user_id; @@ -133,6 +141,7 @@ export default class PostInfo extends React.Component { type='button' data-toggle='dropdown' aria-expanded='false' + onClick={this.dropdownPosition} />