diff --git a/theme/theme.inc b/theme/theme.inc index e7f7a15..f1bffbd 100644 --- a/theme/theme.inc +++ b/theme/theme.inc @@ -698,9 +698,10 @@ function template_preprocess_views_view_grid(&$vars) { } if ($row) { // Fill up the last line only if it's configured, but this is default. - if (!empty($handler->options['fill_single_line']) && count($rows)) { - for ($i = 0; $i < ($columns - $col_count); $i++) { + if (!empty($handler->options['fill_single_line'])) { + for (; $col_count < $columns; $col_count++) { $row[] = ''; + $row_indexes[$row_count][$col_count] = 'fill_' . $col_count; } } $rows[] = $row; @@ -765,6 +766,17 @@ } if (isset($row_indexes[$row_number][$column_number]) && $column_class = $view->style_plugin->get_row_class($row_indexes[$row_number][$column_number])) { $column_classes[] = $column_class; + } + if (empty($item) + && !empty($row_indexes[$row_number][$column_number]) + && ($row_index = $row_indexes[$row_number][$column_number]) + && strpos($row_index, 'fill_') === 0 + && $fill_column_number = substr($row_index, strlen('fill_') - 1, strlen($row_index) - 1) + ) { + $column_classes[] = 'col-fill'; + if ($column_class = $view->style_plugin->get_row_class($row_indexes[$row_number][$fill_column_number])) { + $column_classes[] = $column_class; + } } $vars['column_classes'][$row_number][$column_number] = implode(' ', $column_classes); }