Skip to content
Snippets Groups Projects
Commit fa6d67f2 authored by Alexandre Kühn's avatar Alexandre Kühn
Browse files

[IMP] mail: turn 'ComposerView/hasFooter' into field


Task-2793280

closes odoo/odoo#86468

Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
parent fc9e67bc
No related branches found
No related tags found
No related merge requests found
......@@ -34,23 +34,6 @@ export class Composer extends Component {
return this.messaging && this.messaging.models['ComposerView'].get(this.props.localId);
}
/**
* Determine whether composer should display a footer.
*
* @returns {boolean}
*/
get hasFooter() {
if (!this.composerView) {
return false;
}
return (
this.composerView.hasThreadTyping ||
this.composerView.composer.attachments.length > 0 ||
this.composerView.messageViewInEditing ||
!this.composerView.isCompact
);
}
/**
* Determine whether the composer should display a header.
*
......
......@@ -6,7 +6,7 @@
t-att-class="{
'o-focused': composerView and composerView.isFocused,
'o-has-current-partner-avatar': props.hasCurrentPartnerAvatar,
'o-has-footer': hasFooter,
'o-has-footer': composerView and composerView.hasFooter,
'o-has-header': hasHeader,
'o-is-in-thread-view': composerView and composerView.threadView,
'o-is-compact': composerView and composerView.isCompact,
......@@ -116,7 +116,7 @@
</t>
</div>
</div>
<t t-if="hasFooter">
<t t-if="composerView.hasFooter">
<div class="o_Composer_coreFooter" t-att-class="{ 'o-composer-is-compact': composerView.isCompact }">
<t t-if="composerView.hasThreadTyping">
<ThreadTextualTypingStatus className="'o_Composer_threadTextualTypingStatus'" threadLocalId="composerView.composer.activeThread.localId"/>
......
......@@ -577,6 +577,18 @@ registerModel({
}
return clear();
},
/**
* @private
* @returns {boolean}
*/
_computeHasFooter() {
return Boolean(
this.hasThreadTyping ||
this.composer.attachments.length > 0 ||
this.messageViewInEditing ||
!this.isCompact
);
},
/**
* @private
* @return {boolean}
......@@ -1035,6 +1047,12 @@ registerModel({
compute: '_computeHasFollowers',
default: false,
}),
/**
* Determines whether composer should display a footer.
*/
hasFooter: attr({
compute: '_computeHasFooter',
}),
/**
* States whether there is any result currently found for the current
* suggestion delimiter and search term, if applicable.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment