-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Template.contentBlock consistent #358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, can you please update the chagelog as well?
@StorytellerCZ done - not sure when it will be released, so left it as 2022-XXX |
Alright, I'll see if I can spare more time to take a deeper look. If everything works great, then I would like to have this as a final piece for 2.6 release. |
|
||
// in the case of {{> Template.contentBlock data}} the contentBlock loses the lexical scope of it's parent, wheras {{> Template.contentBlock}} it does not | ||
// this is because a #with sits between the include InOuterTemplateScope | ||
if (currentView.parentView.name === "with" && currentView.parentView.parentView && currentView.parentView.parentView.__childDoesntStartNewLexicalScope) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally break the lines for better readability but that's optional, since we have no definite linter yet (I think)
Is this to be included in 2.6? |
@jankapunkt if it is to be merged, then yes. Could go out as a patch, I think. |
If what's missing for version 2.6 is done soon, this can be merged into version 2.6. |
Currently, content rendered in
{{> Template.contentBlock}}
behaves differently depending on whether data is passed in:This PR fixes this situation by checking if the immediate parent is a
with
and the grandparent is aInOuterTemplateScope
(in addition to if the parent isInOuterTemplateScope
)It also makes a readability change - that while statement was hard to parse.