mirror of https://github.com/OCA/web.git
commit
e99023910a
|
@ -12,16 +12,23 @@ ControlPanel.components = Object.assign({}, ControlPanel.components, {
|
|||
Refresher,
|
||||
});
|
||||
|
||||
/**
|
||||
* @property {String[]} forbiddenSubTypes
|
||||
* @property {Object<String, *>} refresherProps
|
||||
*/
|
||||
patch(ControlPanel.prototype, "web_refresher.ControlPanel", {
|
||||
setup() {
|
||||
this._super(...arguments);
|
||||
const {config, searchModel} = this.env;
|
||||
const forbiddenSubType = ["base_settings"];
|
||||
if (!forbiddenSubType.includes(config.viewSubType)) {
|
||||
this.refresherProps = {
|
||||
searchModel: searchModel,
|
||||
pagerProps: this.pagerProps,
|
||||
};
|
||||
}
|
||||
this.forbiddenSubTypes = ["base_settings"];
|
||||
this.refresherProps = {
|
||||
searchModel: this.env.searchModel,
|
||||
pagerProps: this.pagerProps,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
get displayRefresher() {
|
||||
return !this.forbiddenSubTypes.includes(this.env.config.viewSubType);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -89,9 +89,9 @@ export class Refresher extends Component {
|
|||
* @returns {Promise<Boolean>}
|
||||
*/
|
||||
async refresh() {
|
||||
let updated = this._searchModelRefresh();
|
||||
let updated = await this._pagerRefresh();
|
||||
if (!updated) {
|
||||
updated = await this._pagerRefresh();
|
||||
updated = this._searchModelRefresh();
|
||||
}
|
||||
return updated;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
>
|
||||
<xpath expr="//div[hasclass('o_cp_pager')]" position="before">
|
||||
<div class="oe_cp_refresher" role="search" t-ref="refresher">
|
||||
<Refresher t-props="refresherProps" />
|
||||
<Refresher t-if="displayRefresher" t-props="refresherProps" />
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//div[hasclass('o_cp_bottom_right')]" position="before">
|
||||
|
@ -19,7 +19,7 @@
|
|||
class="o_cp_bottom_right d-flex flex-row-reverse"
|
||||
>
|
||||
<div class="oe_cp_refresher" role="search" t-ref="refresher">
|
||||
<Refresher refresherReport="true" />
|
||||
<Refresher t-if="displayRefresher" refresherReport="true" />
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
|
@ -32,7 +32,7 @@
|
|||
>
|
||||
<xpath expr="//div[hasclass('o_cp_pager')]" position="before">
|
||||
<div class="oe_cp_refresher" role="search" t-ref="refresher">
|
||||
<Refresher t-props="refresherProps" />
|
||||
<Refresher t-if="displayRefresher" t-props="refresherProps" />
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//div[hasclass('o_cp_bottom_right')]" position="before">
|
||||
|
@ -41,7 +41,7 @@
|
|||
class="o_cp_bottom_right d-flex flex-row-reverse"
|
||||
>
|
||||
<div class="oe_cp_refresher" role="search" t-ref="refresher">
|
||||
<Refresher refresherReport="true" />
|
||||
<Refresher t-if="displayRefresher" refresherReport="true" />
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
>
|
||||
<xpath expr="//div[hasclass('o_cp_pager')]" position="before">
|
||||
<div class="oe_cp_refresher" role="search" t-ref="refresher">
|
||||
<Refresher t-props="refresherProps" />
|
||||
<Refresher t-if="displayRefresher" t-props="refresherProps" />
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//div[hasclass('o_cp_bottom_right')]" position="before">
|
||||
|
@ -19,7 +19,7 @@
|
|||
class="o_cp_bottom_right d-flex flex-row-reverse"
|
||||
>
|
||||
<div class="oe_cp_refresher" role="search" t-ref="refresher">
|
||||
<Refresher refresherReport="true" />
|
||||
<Refresher t-if="displayRefresher" refresherReport="true" />
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
|
|
Loading…
Reference in New Issue