Skip to content

Commit

Permalink
Merge pull request #6 from 1drop/bugfix/PRS-285_scroll-to-correct-ele…
Browse files Browse the repository at this point in the history
…ment-after-form-submission

[BUGFIX][PRS-285] adjust form wrapper
  • Loading branch information
Hans Höchtl authored Jul 25, 2019
2 parents 6cecb4b + 78aca62 commit 505ed05
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions Resources/Private/Fusion/Content/Form.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,31 @@ prototype(Onedrop.Form.Hubspot:Content.Form) < prototype(Neos.Neos:ContentCompon
action = 'submit'
format = 'html'
}
id = ${q(node).property('formIdentifier')}
}

content = Onedrop.Form.Hubspot:FormRuntimeFactory {
identifier = ${q(node).property('formIdentifier')}
}

renderer = afx`
<div data-ajax={props.formWrapperAttributes.data-ajax} data-ajax-uri={props.formWrapperAttributes.data-ajax-uri}>
{props.content}
</div>
`
renderer = Neos.Fusion:Tag {
tagName = 'div'

attributes {
data-ajax = ${props.formWrapperAttributes.data-ajax}
data-ajax.@if.hasForm = ${_hasForm}
data-ajax-uri = ${props.formWrapperAttributes.data-ajax-uri}
data-ajax-uri.@if.hasForm = ${_hasForm}
id = ${props.formWrapperAttributes.id}
id.@if.hasNoForm = ${!_hasForm}
}

content = ${props.content}

@context {
_hasForm = ${String.indexOf(props.content, '<form') >= 0}
}
}

@cache {
mode = 'uncached'
Expand Down

0 comments on commit 505ed05

Please sign in to comment.