mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-09 23:59:41 +08:00
[v3] Default context menu always shows in debug/dev
This commit is contained in:
parent
3fcac435b2
commit
5b6f6c1bff
@ -56,7 +56,7 @@ tasks:
|
|||||||
build:production:
|
build:production:
|
||||||
internal: true
|
internal: true
|
||||||
cmds:
|
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:
|
build:production:windows:
|
||||||
cmds:
|
cmds:
|
||||||
|
@ -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
|
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) {
|
function processDefaultContextMenu(event) {
|
||||||
|
// Debug builds always show the menu
|
||||||
|
if(DEBUG) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Process default context menu
|
// Process default context menu
|
||||||
let element = event.target;
|
let element = event.target;
|
||||||
const computedStyle = window.getComputedStyle(element);
|
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
@ -811,7 +811,6 @@ func (w *WebviewWindow) SetFrameless(frameless bool) *WebviewWindow {
|
|||||||
|
|
||||||
func (w *WebviewWindow) dispatchWailsEvent(event *WailsEvent) {
|
func (w *WebviewWindow) dispatchWailsEvent(event *WailsEvent) {
|
||||||
msg := fmt.Sprintf("_wails.dispatchWailsEvent(%s);", event.ToJSON())
|
msg := fmt.Sprintf("_wails.dispatchWailsEvent(%s);", event.ToJSON())
|
||||||
println("Dispatching event: " + msg)
|
|
||||||
w.ExecJS(msg)
|
w.ExecJS(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user