[IMP] web: improve notebook
to allow for easier overriding related to odoo/enterprise/#35426 task-3111695 closes odoo/odoo#109594 X-original-commit: 2ad805d5a88a510844fc398d089b3e3c46e5cb9d Related: odoo/enterprise#35641 Signed-off-by: Laurent Smet <las@odoo.com> Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
This commit is contained in:
committed by
Habib (ayh)
parent
0cdf410a44
commit
7a8a712a34
@@ -108,6 +108,10 @@ export class Notebook extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
activatePage(pageIndex) {
|
||||
this.state.currentPage = pageIndex;
|
||||
}
|
||||
|
||||
computePages(props) {
|
||||
if (!props.slots && !props.pages) {
|
||||
return [];
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="o_notebook_headers" t-att-class="{ 'm-0': props.orientation === 'vertical' }">
|
||||
<ul t-attf-class="nav nav-tabs {{ props.orientation === 'horizontal' ? 'flex-row flex-nowrap' : 'flex-column p-0' }}">
|
||||
<li t-foreach="navItems" t-as="navItem" t-key="navItem[0]" class="nav-item flex-nowrap cursor-pointer" t-if="navItem[1].isVisible">
|
||||
<a class="nav-link" t-attf-class="{{ navItem[0] === state.currentPage ? 'active' : '' }} {{ props.orientation === 'vertical' ? 'p-3 rounded-0' : '' }} {{ navItem[1].className }}" t-att-name="navItem[1].name" t-on-click.prevent="() => state.currentPage = navItem[0]" href="#" role="tab" tabindex="-1" t-esc="navItem[1].title"/>
|
||||
<a class="nav-link" t-attf-class="{{ navItem[0] === state.currentPage ? 'active' : '' }} {{ props.orientation === 'vertical' ? 'p-3 rounded-0' : '' }} {{ navItem[1].className }}" t-att-name="navItem[1].name" t-on-click.prevent="() => this.activatePage(navItem[0])" href="#" role="tab" tabindex="-1" t-esc="navItem[1].title"/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user