Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8 array notification #1477

Merged
merged 17 commits into from
May 5, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ensure _listen is called on rootDataHost, for possible behavior overr…
…iding.
  • Loading branch information
kevinpschaaf committed May 4, 2015
commit 4bc628d4443ec88105459e4d8816153569febf5c
6 changes: 4 additions & 2 deletions src/lib/template/templatizer.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,16 @@
this._tryReady();
},

// Decorate events with model (template instance)
_listenImpl: function(node, eventName, methodName) {
var model = this;
var handler = this._createEventHandler(this._rootDataHost, methodName);
var host = this._rootDataHost;
var handler = host._createEventHandler(methodName);
var decorated = function(e) {
e.model = model;
handler(e);
};
this._listen(node, eventName, decorated);
host._listen(node, eventName, decorated);
},

_scopeElementClassImpl: function(node, value) {
Expand Down
5 changes: 3 additions & 2 deletions src/standard/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@
},

listen: function(node, eventName, methodName) {
this._listen(node, eventName, this._createEventHandler(this, methodName));
this._listen(node, eventName, this._createEventHandler(methodName));
},

_createEventHandler: function(host, methodName) {
_createEventHandler: function(methodName) {
var host = this;
return function(e) {
if (host[methodName]) {
host[methodName](e, e.detail);
Expand Down