pengyuthon wechat
This commit is contained in:
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
@@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
{
|
||||
'name': 'Breadcrumb To Back Button',
|
||||
'summary': 'Breadcrumb To Back Button',
|
||||
'description': 'Breadcrumb To Back Button',
|
||||
'author': 'XSK',
|
||||
'website': '',
|
||||
'category': 'Tools',
|
||||
'version': '17.0',
|
||||
'depends': ['base'],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
'breadcrumb_to_back_button/static/src/**/*',
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @odoo-module **/
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { ControlPanel } from "@web/search/control_panel/control_panel";
|
||||
|
||||
|
||||
patch(ControlPanel.prototype, {
|
||||
|
||||
onBreadcrumbBackClicked(ev) {
|
||||
const jsId = this.breadcrumbs[this.breadcrumbs.length - 2].jsId;
|
||||
this.onBreadcrumbClicked(jsId);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
.breadcrumb-back-div {
|
||||
display: flex;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-inherit="web.Breadcrumbs" t-inherit-mode="extension">
|
||||
<xpath expr="//ol[hasclass('breadcrumb')]" position="attributes">
|
||||
<attribute name="style">display: none !important;</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//div[@t-if='collapsedBreadcrumbs.length || visiblePathBreadcrumbs.length']/div[last()]" position="attributes">
|
||||
<attribute name="style">display: none !important;</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//ol[hasclass('breadcrumb')]" position="after">
|
||||
<div class="breadcrumb-back-div">
|
||||
<button t-if="breadcrumbs.length" class="btn btn-secondary o_attach" t-on-click="(ev) => this.onBreadcrumbBackClicked(ev)" data-tooltip="BACK">
|
||||
<i class="fa fa-chevron-left"/>
|
||||
返回
|
||||
</button>
|
||||
<div class="d-flex gap-1 text-truncate">
|
||||
<div class="o_last_breadcrumb_item active d-flex gap-2 align-items-center min-w-0 lh-sm">
|
||||
<span class="min-w-0 text-truncate" t-call="web.Breadcrumb.Name"/>
|
||||
</div>
|
||||
<t t-call="web.Breadcrumb.Actions"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
Reference in New Issue
Block a user