app/internal/window: remove context-menu (right-click) for wasm

The context-menu seems useless. The only action available, on the
context-menu is to "Save image": which gives a black image.

I think it's better to remove it. The right-click still work and still
provide `pointer.Event`.

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
Inkeliz
2020-11-20 21:18:04 +00:00
committed by Elias Naur
parent 7ca00d5d34
commit fb15547b7a
+4
View File
@@ -120,6 +120,10 @@ func (w *window) addEventListeners() {
w.draw(true)
return nil
})
w.addEventListener(w.window, "contextmenu", func(this js.Value, args []js.Value) interface{} {
args[0].Call("preventDefault")
return nil
})
w.addEventListener(w.cnv, "mousemove", func(this js.Value, args []js.Value) interface{} {
w.pointerEvent(pointer.Move, 0, 0, args[0])
return nil