Chromium Code Reviews| Index: sky/framework/components/ink_well.dart |
| diff --git a/sky/framework/components/ink_well.dart b/sky/framework/components/ink_well.dart |
| index 205e9f38f771ea6d43186337859821b7ac406a2f..67753e13fd32bb5955d7a8e57d64e9d7998deeee 100644 |
| --- a/sky/framework/components/ink_well.dart |
| +++ b/sky/framework/components/ink_well.dart |
| @@ -6,8 +6,9 @@ import '../fn.dart'; |
| import 'dart:collection'; |
| import 'dart:sky' as sky; |
| import 'ink_splash.dart'; |
| +import 'scrollable.dart'; |
| -class InkWell extends Component { |
| +class InkWell extends Component implements ScrollNotifiee { |
|
eseidel
2015/04/20 22:45:04
ScrollClient? ScrollDelegate?
Hixie
2015/04/20 22:49:40
Changed all occurrences of Notifiee to Client.
|
| static final Style _containmentStyleHack = new Style(''' |
| transform: translateX(0);'''); |
| @@ -55,9 +56,30 @@ class InkWell extends Component { |
| pointer: event.primaryPointer, |
| onDone: () { _splashDone(splash); }); |
| _splashes.add(splash); |
| + var node = parent; |
|
eseidel
2015/04/20 22:45:04
Types?
|
| + while (node != null) { |
| + if (node is Scrollable) |
| + node.registerScrollNotifiee(this); |
| + node = node.parent; |
| + } |
| }); |
| } |
| + bool ancestorScrolled(Scrollable ancestor) { |
| + _abortSplashes(); |
| + return false; |
| + } |
| + |
| + void handleRemoved() { |
| + var node = parent; |
| + while (node != null) { |
| + if (node is Scrollable) |
| + node.unregisterScrollNotifiee(this); |
| + node = node.parent; |
| + } |
| + super.handleRemoved(); |
| + } |
| + |
| void _confirmSplash(sky.GestureEvent event) { |
| if (_splashes == null) |
| return; |
| @@ -65,6 +87,14 @@ class InkWell extends Component { |
| .forEach((splash) { splash.confirm(); }); |
| } |
| + void _abortSplashes() { |
| + if (_splashes == null) |
| + return; |
| + setState(() { |
| + _splashes.forEach((s) { s.abort(); }); |
| + }); |
| + } |
| + |
| void _cancelSplashes(sky.Event event) { |
| if (_splashes == null) |
| return; |