| Index: samples-dev/swarm/swarm_ui_lib/touch/EventUtil.dart
|
| diff --git a/samples-dev/swarm/swarm_ui_lib/touch/EventUtil.dart b/samples-dev/swarm/swarm_ui_lib/touch/EventUtil.dart
|
| index 1e9e3db082892f514a3c88d94ef41c5feab95475..8727c0978ac248c21f41cc8e6319631f4339b964 100644
|
| --- a/samples-dev/swarm/swarm_ui_lib/touch/EventUtil.dart
|
| +++ b/samples-dev/swarm/swarm_ui_lib/touch/EventUtil.dart
|
| @@ -8,7 +8,6 @@ part of touch;
|
| * Common events related helpers.
|
| */
|
| class EventUtil {
|
| -
|
| /**
|
| * Add an event listener to an element.
|
| * The event callback is specified by [handler].
|
| @@ -16,14 +15,18 @@ class EventUtil {
|
| * If [removeHandlerOnFocus] is true the handler is removed when there is any
|
| * focus event, and added back on blur events.
|
| */
|
| - static void observe(/*Element or Document*/ element,
|
| - Stream stream, Function handler,
|
| - [bool removeHandlerOnFocus = false]) {
|
| + static void observe(
|
| + /*Element or Document*/ element, Stream stream, Function handler,
|
| + [bool removeHandlerOnFocus = false]) {
|
| var subscription = stream.listen(handler);
|
| // TODO(jacobr): this remove on focus behavior seems really ugly.
|
| if (removeHandlerOnFocus) {
|
| - element.onFocus.listen((e) { subscription.cancel(); });
|
| - element.onBlur.listen((e) { subscription.cancel(); });
|
| + element.onFocus.listen((e) {
|
| + subscription.cancel();
|
| + });
|
| + element.onBlur.listen((e) {
|
| + subscription.cancel();
|
| + });
|
| }
|
| }
|
|
|
|
|