1
0
mirror of https://github.com/flarum/core.git synced 2025-07-28 04:00:40 +02:00

Begin JavaScript cleanup

This commit is contained in:
Toby Zerner
2015-08-26 16:56:24 +09:30
parent c5edf48bf2
commit 734badb4bc
5 changed files with 55 additions and 11 deletions

View File

@@ -1,3 +1,12 @@
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import Component from 'flarum/Component';
import AdminLinkButton from 'flarum/components/AdminLinkButton';
import SelectDropdown from 'flarum/components/SelectDropdown';
@@ -6,13 +15,20 @@ import ItemList from 'flarum/utils/ItemList';
export default class AdminNav extends Component {
view() {
return SelectDropdown.component({
className: 'AdminNav App-titleControl',
buttonClassName: 'Button',
children: this.items().toArray()
});
return (
<SelectDropdown
className="AdminNav App-titleControl"
buttonClassName="Button"
children={this.items().toArray()}
/>
);
}
/**
* Build an item list of links to show in the admin navigation.
*
* @return {ItemList}
*/
items() {
const items = new ItemList();