Skip to content

Commit

Permalink
➖ Remove carbon/condition dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed May 3, 2019
1 parent 9a8cb24 commit e9fda42
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
28 changes: 19 additions & 9 deletions Resources/Private/Fusion/Prototypes/IncludeCase.fusion
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
prototype(Jonnitto.PhotoSwipe:IncludeCase) < prototype(Neos.Fusion:Component) {
prototype(Jonnitto.PhotoSwipe:IncludeCase) < prototype(Neos.Fusion:Component) {
alwaysInclude = ${Configuration.setting('Jonnitto.PhotoSwipe.alwaysInclude')}
selectorCollection = ${Configuration.setting('Jonnitto.PhotoSwipe.selector.collection')}
selectorContent = ${Configuration.setting('Jonnitto.PhotoSwipe.selector.content')}
selectorOnDocument = ${Configuration.setting('Jonnitto.PhotoSwipe.selector.onDocument')}

renderer = Carbon.Condition:Case {
enabled = ${node.context.live ? true : false}
context.live = ${props.alwaysInclude}
includeInBackend = false
node = ${documentNode}

content {
collection = ${props.selectorCollection}
filter = ${props.selectorContent}
renderer = Neos.Fusion:Case {
inBackend {
condition = ${node.context.inBackend}
renderer = ${props.includeInBackend}
}
onDocument {
condition = ${props.selectorOnDocument && q(props.node).is(props.selectorOnDocument)}
renderer = true
}
inContent {
condition = ${props.selectorContent && q(props.node).children(props.selectorCollection).find(props.selectorContent).is()}
renderer = true
}
default {
condition = true
renderer = ${props.alwaysInclude}
}

document.filter = ${props.selectorOnDocument}
}
}
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
}
],
"require": {
"neos/neos": "~3.3 || ~4.0",
"neos/neos": "^3.3 || ^4.0",
"neos/fusion-afx": "^1.0",
"carbon/condition": "^1.1",
"carbon/includeassets": "^3.1"
"carbon/includeassets": "^3.5"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit e9fda42

Please sign in to comment.