Commit 9b5b7809 authored by lic's avatar lic
Browse files

Add amiv-container and minor fixes

parent 3bdddb0b
......@@ -17,6 +17,7 @@ export default class TabComponent {
constructor() {
this.defaultProps = {
className: 'themed-tabs',
activeSelected: true,
};
}
......
......@@ -16,7 +16,6 @@ export default class Layout {
checkLogin();
this.setTabs();
this.selectedTabIndex = 0;
this.lastTabIndex = this.selectedTabIndex;
this.wasLoggedIn = isLoggedIn();
}
......@@ -56,20 +55,19 @@ export default class Layout {
}
onupdate() {
if (this.wasLoggedIn !== isLoggedIn()) this.selectedTabIndex = 0;
this.wasLoggedIn = isLoggedIn();
if (this.lastTabIndex !== this.selectedTabIndex) {
this.lastTabIndex = this.selectedTabIndex;
this.selectTab(this.selectedTabIndex);
if (this.wasLoggedIn !== isLoggedIn()) {
this.selectedTabIndex = 0;
this.wasLoggedIn = isLoggedIn();
this.setTabs();
}
this.setTabs();
}
view(vnode) {
return m('div', [
return m('div#amiv-container', [
m(Tabs, {
onChange: ({ index }) => {
this.selectedTabIndex = index;
this.selectTab(index);
},
tabs: this.tabs.map(tab => ({ label: tab })),
selectedTab: this.selectedTabIndex,
......
......@@ -3,4 +3,10 @@
div {
border: solid 1px black;
}
#amiv-container {
max-width: 1280px;
display: block;
margin: 0 auto;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment