Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Rewrite inserted and removed clauses to match old semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Jan 15, 2014
1 parent e0ac834 commit a1cf222
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function _inserted(element) {
// TODO(sjmiles): when logging, do work on all custom elements so we can
// track behavior even when callbacks not defined
//console.log('inserted: ', element.localName);
if (element.__upgraded__) {
if (element.attachedCallback || element.detachedCallback || (element.__upgraded__ && logFlags.dom)) {
logFlags.dom && console.group('inserted:', element.localName);
if (inDocument(element)) {
element.__inserted = (element.__inserted || 0) + 1;
Expand Down Expand Up @@ -193,7 +193,7 @@ function removed(element) {
function _removed(element) {
// TODO(sjmiles): temporary: do work on all custom elements so we can track
// behavior even when callbacks not defined
if (element.__upgraded__) {
if (element.attachedCallback || element.detachedCallback || (element.__upgraded__ && logFlags.dom)) {
logFlags.dom && console.group('removed:', element.localName);
if (!inDocument(element)) {
element.__inserted = (element.__inserted || 0) - 1;
Expand Down

0 comments on commit a1cf222

Please sign in to comment.