Skip to content

Commit

Permalink
Re-enable listeners of the form 'a.b' (todo: make this more efficient).
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Nov 7, 2015
1 parent ec4d313 commit 139257b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/standard/events.html
Expand Up @@ -55,9 +55,21 @@
*/
listeners: {},

// TODO(sorvell): need to deprecate listening for a.b.
// In the interim, we need to keep a map of listeners by node name
// to avoid these string searches at instance time.
_listenListeners: function(listeners) {
for (var eventName in listeners) {
this.listen(this, eventName, listeners[eventName]);
var node, name, eventName;
for (eventName in listeners) {
if (eventName.indexOf('.') < 0) {
node = this;
name = eventName;
} else {
name = eventName.split('.');
node = this.$[name[0]];
name = name[1];
}
this.listen(node, name, listeners[eventName]);
}
},

Expand Down

0 comments on commit 139257b

Please sign in to comment.