summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_info.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-02-16 08:19:19 -0500
committerJoram Wilander <jwawilander@gmail.com>2016-02-16 08:19:19 -0500
commit6ffcfaa2f38cfb4d4f354c547286d8e29b6efda6 (patch)
tree670551eadc5008231bb1b838edf3fea01d968ad2 /web/react/components/post_info.jsx
parent2ec3762fb2e0140649d138006323b35726b9b213 (diff)
parent44fa72066bacb741c3303633b6a3a690f6fc0d01 (diff)
downloadchat-6ffcfaa2f38cfb4d4f354c547286d8e29b6efda6.tar.gz
chat-6ffcfaa2f38cfb4d4f354c547286d8e29b6efda6.tar.bz2
chat-6ffcfaa2f38cfb4d4f354c547286d8e29b6efda6.zip
Merge pull request #2171 from asaadmahmoodspin/ui-fixes
Multiple UI 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'