Chromium Code Reviews| Index: pkg/polymer/lib/src/events.dart |
| diff --git a/pkg/polymer/lib/src/events.dart b/pkg/polymer/lib/src/events.dart |
| index ccf07861513ee26d3d4a6586cd810ce44d860f1d..78f6297b9361a8f10ca3a5b129f23fc47e17b898 100644 |
| --- a/pkg/polymer/lib/src/events.dart |
| +++ b/pkg/polymer/lib/src/events.dart |
| @@ -89,20 +89,23 @@ abstract class PolymerEventBindings { |
| return (model, node, oneTime) { |
| var handler = getEventHandler(null, node, path); |
| - var sub = node.on[eventType].listen(handler); |
| + _PolymerGestures.callMethod( |
| + 'addEventListener', [node, eventType, handler]); |
|
Siggi Cherem (dart-lang)
2014/08/13 23:00:26
I think we need to bind handler to the current zon
jakemac
2014/08/14 18:00:49
Ah nice good catch, I was just working on a bug th
|
| if (oneTime) return null; |
|
Siggi Cherem (dart-lang)
2014/08/13 23:00:26
I know this is how it was before and how it in JS,
jakemac
2014/08/14 18:00:49
Would you be fine with us filing this as an invest
Siggi Cherem (dart-lang)
2014/08/14 20:51:24
sure thing
|
| - return new _EventBindable(sub, path); |
| + return new _EventBindable(path, node, eventType, handler); |
| }; |
| } |
| } |
| class _EventBindable extends Bindable { |
| - StreamSubscription _sub; |
| final String _path; |
| + final Node _node; |
| + final String _eventType; |
| + final EventListener _handler; |
| - _EventBindable(this._sub, this._path); |
| + _EventBindable(this._path, this._node, this._eventType, this._handler); |
| // TODO(rafaelw): This is really pointless work. Aside from the cost |
| // of these allocations, NodeBind is going to setAttribute back to its |
| @@ -113,10 +116,8 @@ class _EventBindable extends Bindable { |
| open(callback) => value; |
| void close() { |
| - if (_sub != null) { |
| - _sub.cancel(); |
| - _sub = null; |
| - } |
| + _PolymerGestures.callMethod( |
| + 'removeEventListener', [_node, _eventType, _handler]); |
|
Siggi Cherem (dart-lang)
2014/08/13 23:00:26
mmm... I'm not sure if js-interop guarantees that
jakemac
2014/08/14 18:00:49
Could this be solved by jsifying the handler on ou
Siggi Cherem (dart-lang)
2014/08/14 20:51:24
I think that's possible, probably you can create a
|
| } |
| } |