[v2] Add flag to remove default context menu

This commit is contained in:
Lea Anthony
2021-10-19 20:06:18 +11:00
parent 38f37e817b
commit 913cc56adf
3 changed files with 17 additions and 3 deletions
@@ -42,6 +42,7 @@ window.wails = {
callbacks,
flags: {
disableScrollbarDrag: false,
disableWailsDefaultContextMenu: false,
}
};
@@ -77,3 +78,10 @@ window.addEventListener('mousedown', (e) => {
currentElement = currentElement.parentElement;
}
});
// Setup context menu hook
window.addEventListener('contextmenu', function (e) {
if (window.wails.flags.disableWailsDefaultContextMenu) {
e.preventDefault();
}
});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long