[FIX] mail: guard mouseover handlers
Before this commit, some mouseenter and mouseleave handlers were prone to raising a traceback due not being properly guarded. closes odoo/odoo#102652 X-original-commit: f0dafec5c17b0ae0c645156a253c5d93beea7372 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com> Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -17,12 +17,18 @@ registerModel({
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
onMouseenter(ev) {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isHovered: true });
|
||||
},
|
||||
/**
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
onMouseleave(ev) {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isHovered: false });
|
||||
},
|
||||
},
|
||||
|
||||
@@ -11,12 +11,18 @@ registerModel({
|
||||
* Handles mouse enter event for the container of this element.
|
||||
*/
|
||||
onMouseEnter() {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isHovered: true });
|
||||
},
|
||||
/**
|
||||
* Handles mouse leave event for the container of this element.
|
||||
*/
|
||||
onMouseLeave() {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isHovered: false });
|
||||
},
|
||||
},
|
||||
|
||||
@@ -11,12 +11,18 @@ registerModel({
|
||||
* Handles mouse enter event for the container of this element.
|
||||
*/
|
||||
onMouseEnter() {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isHovered: true });
|
||||
},
|
||||
/**
|
||||
* Handles mouse leave event for the container of this element.
|
||||
*/
|
||||
onMouseLeave() {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isHovered: false });
|
||||
},
|
||||
},
|
||||
|
||||
@@ -11,12 +11,18 @@ registerModel({
|
||||
* Handles mouse enter event for the container of this element.
|
||||
*/
|
||||
onMouseEnter() {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isHovered: true });
|
||||
},
|
||||
/**
|
||||
* Handles mouse leave event for the container of this element.
|
||||
*/
|
||||
onMouseLeave() {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isHovered: false });
|
||||
},
|
||||
},
|
||||
|
||||
@@ -303,7 +303,7 @@ registerModel({
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
onMouseEnterTopbarThreadName(ev) {
|
||||
if (!this.thread || !this.thread.isChannelRenamable) {
|
||||
if (!this.exists() || !this.thread || !this.thread.isChannelRenamable) {
|
||||
return;
|
||||
}
|
||||
this.update({ isMouseOverThreadName: true });
|
||||
@@ -325,6 +325,9 @@ registerModel({
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
onMouseEnterUserName(ev) {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isMouseOverUserName: true });
|
||||
},
|
||||
/**
|
||||
@@ -333,6 +336,9 @@ registerModel({
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
onMouseLeaveTopbarThreadName(ev) {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isMouseOverThreadName: false });
|
||||
},
|
||||
/**
|
||||
@@ -341,6 +347,9 @@ registerModel({
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
onMouseLeaveTopbarThreadDescription(ev) {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isMouseOverThreadDescription: false });
|
||||
},
|
||||
/**
|
||||
@@ -349,6 +358,9 @@ registerModel({
|
||||
* @param {MouseEvent} ev
|
||||
*/
|
||||
onMouseLeaveUserName(ev) {
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
this.update({ isMouseOverUserName: false });
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user