Fixed call of popup menu commands with parameters.s
This commit is contained in:
parent
47b178fbc1
commit
12b17fd7af
8
dist/iwmlib.js
vendored
8
dist/iwmlib.js
vendored
@ -6671,9 +6671,11 @@
|
||||
if (this.autoClose) {
|
||||
this.close();
|
||||
}
|
||||
setTimeout(() => {
|
||||
func.call(event, key);
|
||||
}, 20);
|
||||
console.log("perform", event, key);
|
||||
setTimeout((event, key) => {
|
||||
console.log("perform within arrow", event, key);
|
||||
func(event, key);
|
||||
}, 20, event, key);
|
||||
}
|
||||
|
||||
/** Update the menu item denoted by key.
|
||||
|
@ -34,8 +34,8 @@ oncontextmenu="PopupMenu.open(cmds,
|
||||
oncontextmenu="PopupMenu.open(cmds, {x: event.offsetX, y: event.offsetY}, { parent: example, keepWithin: example}); return false;"></div>
|
||||
<script class="doctest">
|
||||
let cmds = {
|
||||
"Start": () => alert("Start"),
|
||||
"Stop": () => alert("Stop")
|
||||
"Start": (event, key) => {console.log("start", event, key); alert(key) },
|
||||
"Stop": (event, key) => alert(key)
|
||||
}
|
||||
let app = new App()
|
||||
let popup = new PopupMenu({ parent: example, fontSize: "2em", autoClose: false })
|
||||
|
@ -113,9 +113,11 @@ export default class PopupMenu extends Popup {
|
||||
if (this.autoClose) {
|
||||
this.close()
|
||||
}
|
||||
setTimeout(() => {
|
||||
func.call(event, key)
|
||||
}, 20)
|
||||
console.log("perform", event, key)
|
||||
setTimeout((event, key) => {
|
||||
console.log("perform within arrow", event, key)
|
||||
func(event, key)
|
||||
}, 20, event, key)
|
||||
}
|
||||
|
||||
/** Update the menu item denoted by key.
|
||||
|
Loading…
Reference in New Issue
Block a user