Commit 7982985a authored by catch's avatar catch

Issue #2226933 by mandar.harkare, mortendk: Remove odd, even, first & last...

Issue #2226933 by mandar.harkare, mortendk: Remove odd, even, first & last classes from views-view-unformatted.html.twig.
parent d12472b2
......@@ -45,19 +45,6 @@ function testDefaultRowClasses() {
$count++;
$attributes = $row->attributes();
$class = (string) $attributes['class'][0];
// Make sure that each row has a row css class.
$this->assertTrue(strpos($class, "views-row-$count") !== FALSE, 'Make sure that each row has a row css class.');
// Make sure that the odd/even classes are set right.
$odd_even = $count % 2 == 0 ? 'even' : 'odd';
$this->assertTrue(strpos($class, "views-row-$odd_even") !== FALSE, 'Make sure that the odd/even classes are set right.');
if ($count == 1) {
$this->assertTrue(strpos($class, "views-row-first") !== FALSE, 'Make sure that the first class is set right.');
}
elseif ($count == $count_result) {
$this->assertTrue(strpos($class, "views-row-last") !== FALSE, 'Make sure that the last class is set right.');
}
$this->assertTrue(strpos($class, 'views-row') !== FALSE, 'Make sure that the views row class is set right.');
}
}
......
......@@ -679,15 +679,6 @@ function template_preprocess_views_view_table(&$variables) {
$count = 0;
foreach ($variables['rows'] as $num => $row) {
$variables['rows'][$num]['attributes'] = array();
if ($row_class_special) {
$variables['rows'][$num]['attributes']['class'][] = ($count++ % 2 == 0) ? 'odd' : 'even';
if ($num === 0) {
$variables['rows'][$num]['attributes']['class'][] = 'views-row-first';
}
elseif ($num === (count($variables['rows']) - 1)) {
$variables['rows'][$num]['attributes']['class'][] = 'views-row-last';
}
}
if ($row_class = $handler->getRowClass($num)) {
$variables['rows'][$num]['attributes']['class'][] = $row_class;
}
......@@ -889,16 +880,6 @@ function template_preprocess_views_view_unformatted(&$variables) {
$count++;
if ($default_row_class) {
$variables['rows'][$id]['attributes']['class'][] = 'views-row';
$variables['rows'][$id]['attributes']['class'][] = 'views-row-' . $count;
}
if ($row_class_special) {
$variables['rows'][$id]['attributes']['class'][] = 'views-row-' . ($count % 2 ? 'odd' : 'even');
if ($count == 1) {
$variables['rows'][$id]['attributes']['class'][] = 'views-row-first';
}
if ($count == $max) {
$variables['rows'][$id]['attributes']['class'][] = 'views-row-last';
}
}
if ($row_class = $view->style_plugin->getRowClass($id)) {
$variables['rows'][$id]['attributes']['class'][] = $row_class;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment