SDA-3267 Close button bugfix

This commit is contained in:
sbenmoussati 2021-08-06 10:37:42 +02:00
parent fbcae64c74
commit cac2cb9f27
2 changed files with 11 additions and 4 deletions

View File

@ -70,7 +70,8 @@ export default class NotificationComp extends React.Component<
INotificationState
> {
private readonly eventHandlers = {
onClose: (winKey) => (_event: mouseEventButton) => this.close(winKey),
onClose: (winKey) => (_event: mouseEventButton) =>
this.close(_event, winKey),
onClick: (data) => (_event: mouseEventButton) => this.click(data),
onContextMenu: (event) => this.contextMenu(event),
onMouseEnter: (winKey) => (_event: mouseEventButton) =>
@ -167,9 +168,13 @@ export default class NotificationComp extends React.Component<
<div
className={`close-button ${themeClassName}`}
title={i18n.t('Close')()}
onClick={this.eventHandlers.onClose(id)}
>
<img src={closeImgFilePath} title={i18n.t('Close')()} alt='close' />
<img
src={closeImgFilePath}
title={i18n.t('Close')()}
alt='close'
onClick={this.eventHandlers.onClose(id)}
/>
</div>
<div
className='main-container'
@ -308,7 +313,8 @@ export default class NotificationComp extends React.Component<
*
* @param id {number}
*/
private close(id: number): void {
private close(event: any, id: number): void {
event.stopPropagation();
ipcRenderer.send('close-notification', id);
}

View File

@ -61,6 +61,7 @@ body {
line-height: 15px;
&:hover > .close-button {
display: block;
z-index: 5;
}
.main-container {