[IMP] mail: turn 'MessageView/isClicked' into field
Task-2793280 closes odoo/odoo#86966 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -29,11 +29,6 @@ export class Message extends Component {
|
||||
* it displays message actions.
|
||||
*/
|
||||
isHovered: false,
|
||||
/**
|
||||
* Determine whether the message is clicked. When message is in
|
||||
* clicked state, it keeps displaying actions even if not hovered.
|
||||
*/
|
||||
isClicked: false,
|
||||
});
|
||||
useUpdate({ func: () => this._update() });
|
||||
/**
|
||||
@@ -94,7 +89,7 @@ export class Message extends Component {
|
||||
get isActive() {
|
||||
return Boolean(
|
||||
this.state.isHovered ||
|
||||
this.state.isClicked ||
|
||||
(this.messageView && this.messageView.isClicked) ||
|
||||
(
|
||||
this.messageView &&
|
||||
this.messageView.messageActionList &&
|
||||
@@ -345,7 +340,7 @@ export class Message extends Component {
|
||||
!isEventHandled(ev, 'MessageReactionGroup.Click') &&
|
||||
!isEventHandled(ev, 'MessageInReplyToView.ClickMessageInReplyTo')
|
||||
) {
|
||||
this.state.isClicked = !this.state.isClicked;
|
||||
this.messageView.update({ isClicked: !this.messageView.isClicked });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="o_Message position-relative pt-1"
|
||||
t-att-class="{
|
||||
'o_Message_active': isActive,
|
||||
'o-clicked': state.isClicked,
|
||||
'o-clicked': messageView.isClicked,
|
||||
'o-discussion': messageView.message.is_discussion or messageView.message.is_notification,
|
||||
'o-has-message-selection': messageView.threadView and messageView.threadView.replyingToMessageView,
|
||||
'o-highlighted': messageView.message.isHighlighted or messageView.isHighlighted,
|
||||
|
||||
@@ -233,6 +233,13 @@ registerModel({
|
||||
* id of the current timeout that will reset isHighlighted to false.
|
||||
*/
|
||||
highlightTimeout: attr(),
|
||||
/**
|
||||
* Determines whether the message is clicked. When message is in
|
||||
* clicked state, it keeps displaying actions even if not hovered.
|
||||
*/
|
||||
isClicked: attr({
|
||||
default: false
|
||||
}),
|
||||
/**
|
||||
* Whether the message should be forced to be isHighlighted. Should only
|
||||
* be set through @see highlight()
|
||||
|
||||
Reference in New Issue
Block a user