Skip to content
Snippets Groups Projects
Commit 1c623447 authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Fixed grid [size]-margin-collapse classes by layout_[size]_collapse setting....

Fixed grid [size]-margin-collapse classes by layout_[size]_collapse setting. This should set the classes on the parent wrapper / container and NOT on his own layout wrapper attributes.
parent 15ef438e
No related branches found
Tags 7.98
No related merge requests found
......@@ -59,18 +59,7 @@ function drowl_paragraphs_preprocess_paragraph(&$variables) {
if (!empty($ps['layout_sm_indent'])) {
$variables['layout_attributes']->addClass('small-offset-' . $ps['layout_sm_indent']);
}
// TODO: This setting is dropped in Foundation - remove
// if (!empty($ps['layout_sm_reverse_indent'])) {
// $variables['layout_attributes']->addClass('small-rev-offset-' . $ps['layout_sm_reverse_indent']);
// }
if (!empty($ps['layout_sm_collapse'])) {
$variables['layout_wrapper_attributes']->addClass('small-margin-collapse');
}
// TODO: This setting is dropped in Foundation - remove
// if (!empty($ps['layout_sm_uncollapse'])) {
// $variables['layout_attributes']->addClass('small-margin-collapse');
// }
if (!empty($ps['layout_md_columns'])) {
$variables['layout_attributes']->addClass('cell');
if ($ps['layout_md_columns'] >= 1) {
......@@ -80,18 +69,7 @@ function drowl_paragraphs_preprocess_paragraph(&$variables) {
if (!empty($ps['layout_md_indent'])) {
$variables['layout_attributes']->addClass('medium-offset-' . $ps['layout_md_indent']);
}
// TODO: This setting is dropped in Foundation - remove
// if (!empty($ps['layout_md_reverse_indent'])) {
// $variables['layout_attributes']->addClass('medium-rev-offset-' . $ps['layout_md_reverse_indent']);
// }
if (!empty($ps['layout_md_collapse'])) {
$variables['layout_wrapper_attributes']->addClass('medium-margin-collapse');
}
// TODO: This setting is dropped in Foundation - remove
// if (!empty($ps['layout_md_uncollapse'])) {
// $variables['layout_attributes']->addClass('medium-uncollapse');
// }
if (!empty($ps['layout_lg_columns'])) {
$variables['layout_attributes']->addClass('cell');
if ($ps['layout_lg_columns'] >= 1) {
......@@ -101,18 +79,7 @@ function drowl_paragraphs_preprocess_paragraph(&$variables) {
if (!empty($ps['layout_lg_indent'])) {
$variables['layout_attributes']->addClass('large-offset-' . $ps['layout_lg_indent']);
}
// TODO: This setting is dropped in Foundation - remove
// if (!empty($ps['layout_lg_reverse_indent'])) {
// $variables['layout_attributes']->addClass('large-rev-offset-' . $ps['layout_lg_reverse_indent']);
// }
if (!empty($ps['layout_lg_collapse'])) {
$variables['layout_wrapper_attributes']->addClass('large-margin-collapse');
}
// TODO: This setting is dropped in Foundation - remove
// if (!empty($ps['layout_lg_uncollapse'])) {
// $variables['layout_attributes']->addClass('large-uncollapse');
// }
if (!empty($ps['layout_margin_top'])) {
$variables['attributes']->addClass('mt-' . $ps['layout_margin_top']);
}
......@@ -258,6 +225,16 @@ function drowl_paragraphs_preprocess_paragraph(&$variables) {
$variables['is_row'] = TRUE;
$variables['attributes']->addClass('has-layout');
$variables['layout_wrapper_attributes']->addClass(['grid-x', 'grid-margin-x']);
if (!empty($subParagraphSettingsArray[0]['layout_sm_collapse'])) {
$variables['layout_wrapper_attributes']->addClass('small-margin-collapse');
}
if (!empty($subParagraphSettingsArray[0]['layout_md_collapse'])) {
$variables['layout_wrapper_attributes']->addClass('medium-margin-collapse');
}
if (!empty($subParagraphSettingsArray[0]['layout_lg_collapse'])) {
$variables['layout_wrapper_attributes']->addClass('large-margin-collapse');
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment