5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-09 21:31:28 +08:00

[v3] Default context menu always shows in debug/dev

This commit is contained in:
Lea Anthony 2023-06-28 18:47:39 +10:00
parent 3fcac435b2
commit 5b6f6c1bff
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
9 changed files with 33 additions and 23 deletions

View File

@ -56,7 +56,7 @@ tasks:
build:production:
internal: true
cmds:
- npx esbuild desktop/main.js --bundle --tree-shaking=true --minify --outfile=runtime_production_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
- npx esbuild desktop/main.js --bundle --tree-shaking=true --minify --outfile=runtime_production_desktop_{{.PLATFORM}}.js --define:DEBUG=false --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
build:production:windows:
cmds:

View File

@ -34,6 +34,11 @@ Default: Show default context menu if contentEditable: true OR text has been sel
Anything nested under a tag with --default-contextmenu: hide will not show the context menu unless it is explicitly set with --default-contextmenu: show
*/
function processDefaultContextMenu(event) {
// Debug builds always show the menu
if(DEBUG) {
return;
}
// Process default context menu
let element = event.target;
const computedStyle = window.getComputedStyle(element);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -811,7 +811,6 @@ func (w *WebviewWindow) SetFrameless(frameless bool) *WebviewWindow {
func (w *WebviewWindow) dispatchWailsEvent(event *WailsEvent) {
msg := fmt.Sprintf("_wails.dispatchWailsEvent(%s);", event.ToJSON())
println("Dispatching event: " + msg)
w.ExecJS(msg)
}