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

Unified Diff: sky/framework/components/material.dart

Issue 1019633004: Change how events are handled in Effen (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr changes Created 5 years, 9 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
« no previous file with comments | « sky/framework/components/fixed_height_scrollable.dart ('k') | sky/framework/components/menu_item.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/material.dart
diff --git a/sky/framework/components/material.dart b/sky/framework/components/material.dart
index fd1941160af65cbaa41fa4f1bd752c69ca99bd5f..12ee60724a5c2aee480af1e9117ca0f11c212b0d 100644
--- a/sky/framework/components/material.dart
+++ b/sky/framework/components/material.dart
@@ -30,11 +30,7 @@ class Material extends Component {
this.style,
this.inlineStyle,
this.children,
- this.level: 0 }) : super(key: key) {
- events.listen('gesturescrollstart', _cancelSplashes);
- events.listen('wheel', _cancelSplashes);
- events.listen('pointerdown', _startSplash);
- }
+ this.level: 0 }) : super(key: key);
Node build() {
List<Node> childrenIncludingSplashes = [];
@@ -47,10 +43,15 @@ class Material extends Component {
if (children != null)
childrenIncludingSplashes.addAll(children);
- return new Container(
- style: level > 0 ? style.extend(shadowStyle[level]) : style,
- inlineStyle: inlineStyle,
- children: childrenIncludingSplashes);
+ return new EventTarget(
+ new Container(
+ style: level > 0 ? style.extend(shadowStyle[level]) : style,
+ inlineStyle: inlineStyle,
+ children: childrenIncludingSplashes),
+ onGestureScrollStart: _cancelSplashes,
+ onWheel: _cancelSplashes,
+ onPointerDown: _startSplash
+ );
}
sky.ClientRect _getBoundingRect() => (getRoot() as sky.Element).getBoundingClientRect();
« no previous file with comments | « sky/framework/components/fixed_height_scrollable.dart ('k') | sky/framework/components/menu_item.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698