summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_info.jsx
diff options
context:
space:
mode:
authorAsaad Mahmood <asaad@spinpunch.com>2016-02-15 23:23:07 +0500
committerAsaad Mahmood <asaad@spinpunch.com>2016-02-15 23:23:07 +0500
commit44fa72066bacb741c3303633b6a3a690f6fc0d01 (patch)
tree670551eadc5008231bb1b838edf3fea01d968ad2 /web/react/components/post_info.jsx
parent22aa2c8c07075f603a1408b7185c01b49d92fc7f (diff)
downloadchat-44fa72066bacb741c3303633b6a3a690f6fc0d01.tar.gz
chat-44fa72066bacb741c3303633b6a3a690f6fc0d01.tar.bz2
chat-44fa72066bacb741c3303633b6a3a690f6fc0d01.zip
Other minor improvements
Diffstat (limited to 'web/react/components/post_info.jsx')
-rw-r--r--web/react/components/post_info.jsx9
1 files changed, 9 insertions, 0 deletions
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}
/>
<ul
className='dropdown-menu'