summaryrefslogtreecommitdiffstats
path: root/ui/src
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-09-11 17:20:57 -0700
committerDessalines <tyhou13@gmx.com>2019-09-11 17:20:57 -0700
commitc2ddbec504707e84ca54176e4cd85c9d44f44afa (patch)
tree561a0fa7df415f2f2ff5cd0164af8681fd530059 /ui/src
parent0eb7d6c30487b383720d8e0aa417926a37df3aef (diff)
Fixing tribute positioning issue, moving recent comments to top.
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/components/comment-form.tsx10
-rw-r--r--ui/src/components/post.tsx4
-rw-r--r--ui/src/css/main.css2
-rw-r--r--ui/src/css/tribute.css4
4 files changed, 12 insertions, 8 deletions
diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx
index 5b60aced..5baec725 100644
--- a/ui/src/components/comment-form.tsx
+++ b/ui/src/components/comment-form.tsx
@@ -6,7 +6,7 @@ import { WebSocketService, UserService } from '../services';
import * as autosize from 'autosize';
import { i18n } from '../i18next';
import { T } from 'inferno-i18next';
-import Tribute from 'tributejs/src/Tribute.js';
+import * as Tribute from 'tributejs';
import * as emojiShortName from 'emoji-short-name';
interface CommentFormProps {
@@ -60,7 +60,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
values: Object.entries(emojiShortName).map(e => {return {'key': e[1], 'val': e[0]}}),
allowSpaces: false,
autocompleteMode: true,
- menuItemLimit: 10,
+ menuItemLimit: mentionDropdownFetchLimit,
},
// Users
{
@@ -73,7 +73,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
},
allowSpaces: false,
autocompleteMode: true,
- menuItemLimit: 10,
+ menuItemLimit: mentionDropdownFetchLimit,
},
// Communities
@@ -87,7 +87,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
},
allowSpaces: false,
autocompleteMode: true,
- menuItemLimit: 10,
+ menuItemLimit: mentionDropdownFetchLimit,
}
]
});
@@ -123,7 +123,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
<div class="mb-3">
<form onSubmit={linkEvent(this, this.handleCommentSubmit)}>
<div class="form-group row">
- <div class="col-sm-12">
+ <div className={`col-sm-12`}>
<textarea id={this.id} className={`form-control ${this.state.previewMode && 'd-none'}`} value={this.state.commentForm.content} onInput={linkEvent(this, this.handleCommentContentChange)} required disabled={this.props.disabled} rows={2} maxLength={10000} />
{this.state.previewMode &&
<div className="md-div" dangerouslySetInnerHTML={mdToHtml(this.state.commentForm.content)} />
diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx
index 7e2dbd62..5047d20b 100644
--- a/ui/src/components/post.tsx
+++ b/ui/src/components/post.tsx
@@ -140,8 +140,8 @@ export class Post extends Component<any, PostState> {
{this.commentsTree()}
</div>
<div class="col-12 col-sm-12 col-md-4">
- {this.sidebar()}
{this.state.comments.length > 0 && this.newComments()}
+ {this.sidebar()}
</div>
</div>
}
@@ -173,7 +173,7 @@ export class Post extends Component<any, PostState> {
newComments() {
return (
- <div class="d-none d-md-block sticky-top new-comments card border-secondary">
+ <div class="d-none d-md-block new-comments mb-3 card border-secondary">
<div class="card-body small">
<h6><T i18nKey="recent_comments">#</T></h6>
{this.state.comments.map(comment =>
diff --git a/ui/src/css/main.css b/ui/src/css/main.css
index 7bfdb6d0..61c998bc 100644
--- a/ui/src/css/main.css
+++ b/ui/src/css/main.css
@@ -115,7 +115,7 @@ blockquote {
}
.new-comments {
- max-height: 100vh;
+ max-height: 50vh;
overflow: hidden;
}
diff --git a/ui/src/css/tribute.css b/ui/src/css/tribute.css
index e990e64f..cc44a403 100644
--- a/ui/src/css/tribute.css
+++ b/ui/src/css/tribute.css
@@ -1,3 +1,7 @@
+body {
+ position: relative;
+}
+
.tribute-container {
position: absolute;
top: 0;