Skip to content

Commit

Permalink
fix(content-selector): incorrection projection in nested scenarios
Browse files Browse the repository at this point in the history
Fixes #231
  • Loading branch information
EisenbergEffect committed Dec 9, 2015
1 parent 59f912d commit 2e24867
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/composition-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface CompositionContext {
*/
viewModel?: any;
/**
* Data to be passed to the "activate" hook on the view model.
* Data to be passed to the "activate" hook on the view model.
*/
model?: any;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/content-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class _ContentSelector {
while (currentChild) {
nextSibling = currentChild.nextSibling;

if (currentChild.viewSlot) {
if (currentChild.isContentProjectionSource) {
let viewSlotSelectors = contentSelectors.map(x => x.copyForViewSlot());
currentChild.viewSlot._installContentSelectors(viewSlotSelectors);
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/instructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export class TargetInstruction {
instruction.behaviorInstructions = [liftingInstruction];
instruction.viewFactory = liftingInstruction.viewFactory;
instruction.providers = [liftingInstruction.type.target];
instruction.lifting = true;
return instruction;
}

Expand Down Expand Up @@ -266,6 +267,7 @@ export class TargetInstruction {

this.anchorIsContainer = false;
this.elementInstruction = null;
this.lifting = false;

this.values = null;
}
Expand Down
1 change: 1 addition & 0 deletions src/view-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function elementContainerGet(key) {
if (key === ViewSlot) {
if (this.viewSlot === undefined) {
this.viewSlot = new ViewSlot(this.element, this.instruction.anchorIsContainer);
this.element.isContentProjectionSource = this.instruction.lifting;
this.children.push(this.viewSlot);
}

Expand Down
1 change: 1 addition & 0 deletions src/view-slot.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class ViewSlot {
this.isAttached = false;
this.contentSelectors = null;
anchor.viewSlot = this;
anchor.isContentProjectionSource = false;
}

/**
Expand Down

0 comments on commit 2e24867

Please sign in to comment.