1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 22:20:21 +02:00

Make the toolbar fixed to the top; tweak contents

Add a comment count (which links to the full discussion) and show the reply button normally on mobile.
This commit is contained in:
Toby Zerner
2015-11-03 18:11:31 +10:30
parent b21374e520
commit 5041428b8c
2 changed files with 32 additions and 1 deletions

View File

@@ -31,6 +31,17 @@ export default class DiscussionPage extends BaseDiscussionPage {
items.remove('scrubber'); items.remove('scrubber');
const count = this.discussion.repliesCount();
items.add('replies', <h3>
<a href={app.route.discussion(this.discussion).replace('/embed', '/d')} config={m.route}>
{count} comment{count == 1 ? '' : 's'}
</a>
</h3>, 100);
const props = items.get('controls').props;
props.className = props.className.replace('App-primaryControl', '');
return items; return items;
} }
} }

View File

@@ -14,12 +14,24 @@
border-top: 0; border-top: 0;
} }
.DiscussionPage-nav--embed { .DiscussionPage-nav--embed {
height: 70px;
> ul { > ul {
padding: 0; z-index: 100;
background: @body-bg;
list-style: none; list-style: none;
padding: 0;
margin: 0; margin: 0;
border-bottom: 1px solid @control-bg; border-bottom: 1px solid @control-bg;
@media @tablet-up {
position: fixed;
left: 0;
right: 0;
top: 0;
padding: 0 15px;
}
> li { > li {
margin: 15px 15px 15px 0; margin: 15px 15px 15px 0;
display: inline-block; display: inline-block;
@@ -29,6 +41,14 @@
right: auto; right: auto;
} }
} }
.item-replies h3 {
font-weight: normal;
margin: 0;
&, a {
color: @muted-color;
}
}
} }
} }
.DiscussionPage-stream { .DiscussionPage-stream {