Show sidebar items at top of embed

This commit is contained in:
Toby Zerner 2015-10-27 12:03:03 +10:30
parent 5e734ca5c9
commit 40c32e1b3a
3 changed files with 97 additions and 55 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
import BaseDiscussionPage from 'flarum/components/DiscussionPage';
import PostStream from 'flarum/components/PostStream';
import listItems from 'flarum/helpers/listItems';
export default class DiscussionPage extends BaseDiscussionPage {
init() {
@ -13,6 +14,9 @@ export default class DiscussionPage extends BaseDiscussionPage {
<div className="DiscussionPage">
<div class="container">
<div className="DiscussionPage-discussion">
<nav className="DiscussionPage-nav--embed">
<ul>{listItems(this.sidebarItems().toArray())}</ul>
</nav>
<div className="DiscussionPage-stream">
{this.stream ? this.stream.render() : ''}
</div>
@ -21,4 +25,12 @@ export default class DiscussionPage extends BaseDiscussionPage {
</div>
);
}
sidebarItems() {
const items = super.sidebarItems();
delete items.scrubber;
return items;
}
}

View File

@ -13,6 +13,24 @@
.App-content {
border-top: 0;
}
.DiscussionPage-nav--embed {
> ul {
padding: 0;
list-style: none;
margin: 0;
border-bottom: 1px solid @control-bg;
> li {
margin: 15px 15px 15px 0;
display: inline-block;
.Dropdown-menu {
left: 0;
right: auto;
}
}
}
}
.DiscussionPage-stream {
margin-right: 0;
}