Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove contextMenuModule per default #63

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/vscode-integration-webview/src/default-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { ModuleConfiguration } from '@eclipse-glsp/client';
import { ModuleConfiguration, contextMenuModule } from '@eclipse-glsp/client';
import { vscodeCopyPasteModule } from './features/copyPaste/copy-paste-module';
import { vscodeDefaultModule } from './features/default/default-module';
import { vscodeExportModule } from './features/export/export-module';
Expand All @@ -30,5 +30,6 @@ export const VSCODE_DEFAULT_MODULES = [
] as const;

export const VSCODE_DEFAULT_MODULE_CONFIG: ModuleConfiguration = {
add: [...VSCODE_DEFAULT_MODULES]
add: [...VSCODE_DEFAULT_MODULES],
remove: [contextMenuModule]
};
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,17 @@ export abstract class GLSPDiagramWidget {
containerDiv.addEventListener('mouseleave', e => this.handleMouseLeave(e));
window.addEventListener('focus', e => this.handleFocusChange(e, true));
window.addEventListener('blur', e => this.handleFocusChange(e, false));
window.addEventListener('contextmenu', e => this.handleContextMenu(e));
}
}

handleContextMenu(e: MouseEvent): void {
// Prevent the default context menu for now
// Should be removed once we provide a proper context menu integration
e.preventDefault();
window.focus();
}

handleMouseEnter(e: MouseEvent): void {
this.containerDiv?.classList.add('mouse-enter');
this.containerDiv?.classList.remove('mouse-leave');
Expand Down