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) {
|
if (this.autoClose) {
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
console.log("perform", event, key);
|
||||||
func.call(event, key);
|
setTimeout((event, key) => {
|
||||||
}, 20);
|
console.log("perform within arrow", event, key);
|
||||||
|
func(event, key);
|
||||||
|
}, 20, event, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Update the menu item denoted by 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>
|
oncontextmenu="PopupMenu.open(cmds, {x: event.offsetX, y: event.offsetY}, { parent: example, keepWithin: example}); return false;"></div>
|
||||||
<script class="doctest">
|
<script class="doctest">
|
||||||
let cmds = {
|
let cmds = {
|
||||||
"Start": () => alert("Start"),
|
"Start": (event, key) => {console.log("start", event, key); alert(key) },
|
||||||
"Stop": () => alert("Stop")
|
"Stop": (event, key) => alert(key)
|
||||||
}
|
}
|
||||||
let app = new App()
|
let app = new App()
|
||||||
let popup = new PopupMenu({ parent: example, fontSize: "2em", autoClose: false })
|
let popup = new PopupMenu({ parent: example, fontSize: "2em", autoClose: false })
|
||||||
|
@ -113,9 +113,11 @@ export default class PopupMenu extends Popup {
|
|||||||
if (this.autoClose) {
|
if (this.autoClose) {
|
||||||
this.close()
|
this.close()
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
console.log("perform", event, key)
|
||||||
func.call(event, key)
|
setTimeout((event, key) => {
|
||||||
}, 20)
|
console.log("perform within arrow", event, key)
|
||||||
|
func(event, key)
|
||||||
|
}, 20, event, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Update the menu item denoted by key.
|
/** Update the menu item denoted by key.
|
||||||
|
Loading…
Reference in New Issue
Block a user