Open
Bug 461578
Opened 16 years ago
Updated 2 years ago
Allow doCommand to take an optional event
Categories
(Core :: DOM: Events, defect, P3)
Core
DOM: Events
Tracking
()
NEW
People
(Reporter: Mardak, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Related to bug 246720 where a command's oncommand attribute isn't accessible through javascript without first calling doCommand, the goal of wanting to do oncommand(event) is to pass a custom event to the command. Another way to get that is if doCommand took in an optional event argument.
Comment 1•16 years ago
|
||
I don't understand this bug at all.
Reporter | ||
Comment 2•16 years ago
|
||
For example, browser has.. <command id="Browser:BackOrBackDuplicate" oncommand="BrowserBack(event);"/> I want to trigger the command with a specific event such as a mouse click with certain meta/shift/etc keys set true. So if this bug is fixed, one would be able to do something like cmd.doCommand(keyEvent); cmd.doCommand(mouseEvent); instead of doing oncommand = new Function("event", cmd.getAttribute("oncommand")); oncommand.call(cmd, keyEvent); oncommand.call(cmd, mouseEvent); So maybe something like.. void nsIDOMXULElement::doCommand([optional] in nsIDOMEvent evt) ?
Comment 3•16 years ago
|
||
.oncommand gets called with command event, not with keyEvent or mouseEvent. So if doCommand is extended, it should take nsIDOMXULCommandEvent, not nsIDOMEvent
Comment 4•16 years ago
|
||
> I want to trigger the command with a specific event such as a mouse click with > certain meta/shift/etc keys set true. Ah, what you actually want is to have the modifier state initialized. > So maybe something like.. > void nsIDOMXULElement::doCommand([optional] in nsIDOMEvent evt) ? Yes, and nsIDOMXULCommandEvent should be extended to have the four modifier properties available.
Comment 5•16 years ago
|
||
(In reply to comment #4) > Yes, and nsIDOMXULCommandEvent should be extended to have the four modifier > properties available. It already does! You might want to add the button property though?
Updated•6 years ago
|
Priority: -- → P3
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•