If the button is a toggle button and no arg has been specified,
pass the value of 'selected' (true or false) as the argument. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4349 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -36,8 +36,14 @@ public class CommandButton extends Button
|
||||
if (enabled) {
|
||||
// stop the click event
|
||||
event.stopImmediatePropagation();
|
||||
|
||||
// dispatch the command event
|
||||
CommandEvent.dispatch(this, _cmd, _arg);
|
||||
// if the arg is null and we're a toggle button, dispatch our state
|
||||
var arg :Object = _arg;
|
||||
if (arg == null && toggle) {
|
||||
arg = selected;
|
||||
}
|
||||
CommandEvent.dispatch(this, _cmd, arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user