Skip to content

Commit

Permalink
add 'onMutation' (experimental) function to Base
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott J. Miles committed Sep 9, 2013
1 parent 37e4ff9 commit 528129c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/instance/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@
if (this.attributeChanged) {
this.attributeChanged.apply(this, arguments);
}
},
onMutation: function(node, listener) {
var observer = new MutationObserver(function() {
listener.call(this, observer);
observer.disconnect();
}.bind(this));
observer.observe(node, {childList: true, subtree: true});
}
};

Expand Down

0 comments on commit 528129c

Please sign in to comment.