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;
|
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
|
override public function clone () :Event
|
||||||
{
|
{
|
||||||
return create(command, arg);
|
return create(command, arg);
|
||||||
|
|||||||
@@ -96,8 +96,7 @@ public class Controller
|
|||||||
if (handleAction(event.command, event.arg)) {
|
if (handleAction(event.command, event.arg)) {
|
||||||
// if we handle the event, stop it from moving outward to another
|
// if we handle the event, stop it from moving outward to another
|
||||||
// controller
|
// controller
|
||||||
event.preventDefault();
|
event.markAsHandled();
|
||||||
event.stopImmediatePropagation();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user