Added CommandEvent.markAsHandled().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4430 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -47,6 +47,16 @@ public class CommandEvent extends Event
|
||||
this.arg = arg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark this command as handled, stopping its propagation up the
|
||||
* hierarchy.
|
||||
*/
|
||||
public function markAsHandled () :void
|
||||
{
|
||||
preventDefault();
|
||||
stopImmediatePropagation();
|
||||
}
|
||||
|
||||
override public function clone () :Event
|
||||
{
|
||||
return create(command, arg);
|
||||
|
||||
@@ -96,8 +96,7 @@ public class Controller
|
||||
if (handleAction(event.command, event.arg)) {
|
||||
// if we handle the event, stop it from moving outward to another
|
||||
// controller
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
event.markAsHandled();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user