Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: samples-dev/swarm/swarm_ui_lib/touch/EventUtil.dart

Issue 2828603002: Format samples and samples-dev directories. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
+ });
}
}
« no previous file with comments | « samples-dev/swarm/swarm_ui_lib/touch/ClickBuster.dart ('k') | samples-dev/swarm/swarm_ui_lib/touch/FxUtil.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698