Skip to content

Commit

Permalink
small bug fixed: when div where pileup is visualized was inside anoth…
Browse files Browse the repository at this point in the history
…er tag that was dynamically added pileup component wasn't updated
  • Loading branch information
piotr-gawron committed Jul 27, 2016
1 parent 04d0da5 commit 8480090
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/pileup.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ function create(elOrId: string|Element, params: PileupParams): Pileup {
if (mutation.type === 'childList') {
var added= false;
for (var i=0; i<mutation.addedNodes.length;i++) {
if (mutation.addedNodes[i]===el) {
//when added element is element where we visualize pileup
//or it contains element where we visualize pileup
//then we will have to update component
if (mutation.addedNodes[i]===el || mutation.addedNodes[i].contains(el)) {
added = true;
}
}
Expand All @@ -106,7 +109,7 @@ function create(elOrId: string|Element, params: PileupParams): Pileup {
});
});
// configuration of the observer:
var config = { childList: true, subtree: true };
var config = {attributes: true, childList: true, characterData: true, subtree: true};

// start observing document
observer.observe(document, config);
Expand Down

0 comments on commit 8480090

Please sign in to comment.