mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
fix: ELECTRON-1037 (Disable context menu for notification windows) (#708)
* ELECTRON-1037 - Disable context menu for notification windows * ELECTRON-1037 - Fix typo
This commit is contained in:
parent
5faa766f07
commit
278257c1d1
@ -23,6 +23,7 @@ export default class NotificationComp extends React.Component<{}, IState> {
|
||||
private readonly eventHandlers = {
|
||||
onClose: (winKey) => (_event: mouseEventButton) => this.close(winKey),
|
||||
onClick: (data) => (_event: mouseEventButton) => this.click(data),
|
||||
onContextMenu: (event) => this.contextMenu(event),
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
@ -59,7 +60,7 @@ export default class NotificationComp extends React.Component<{}, IState> {
|
||||
const bgColor = { backgroundColor: colorHex || '#ffffff' };
|
||||
|
||||
return (
|
||||
<div className='container' role='alert' style={bgColor} onClick={this.eventHandlers.onClick(id)}>
|
||||
<div className='container' onContextMenu={this.eventHandlers.onContextMenu} role='alert' style={bgColor} onClick={this.eventHandlers.onClick(id)}>
|
||||
<div className='logo-container'>
|
||||
<img className={`logo ${theme}`} alt='symphony logo'/>
|
||||
</div>
|
||||
@ -99,6 +100,15 @@ export default class NotificationComp extends React.Component<{}, IState> {
|
||||
ipcRenderer.send('close-notification', id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable context menu
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
private contextMenu(event) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the About app state
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user