Skip to content
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

Toggle switch helper should add class param to its container #341

Merged
merged 3 commits into from Sep 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,9 @@
<div class="form__group foo form__group--toggle">
<label for="toggletest" class="control__label">Toggle</label>
<div class="controls">
<input label="Toggle" id="toggletest" type="checkbox" class="form__control toggle-switch" />
<label for="toggletest" class="control__label toggle-switch-label">
<span class="hide">Toggle</span>
</label>
</div>
</div>
@@ -0,0 +1,10 @@
{% extends '@cssTests/visual-regression-layout.html.twig' %}
{% block body %}
{{
form.toggle_switch({
'class': 'foo',
'label': 'Toggle',
'id': 'toggletest'
})
}}
{% endblock %}
2 changes: 1 addition & 1 deletion views/pulsar/v2/helpers/form.html.twig
Expand Up @@ -1803,7 +1803,7 @@ data-* | string | Data attributes, eg: `'data-foo': 'bar'`
'parent': options
|only('bare class error guidance guidance-container help id label required')
|merge({
'class': 'form__group--toggle'
'class': options.class|default ~ ' form__group--toggle'
}),
'inputs': [toggle]
})
Expand Down