You are here

protected function GridBase::unique in GridStack 8.2

Returns attempted optimized column widths per chunck.

1 call to GridBase::unique()
GridBase::optimizeClasses in src/Plugin/gridstack/engine/GridBase.php
Optimize grid widths to remove similar widths.

File

src/Plugin/gridstack/engine/GridBase.php, line 87

Class

GridBase
Provides the base class for one-dimensional layout engines.

Namespace

Drupal\gridstack\Plugin\gridstack\engine

Code

protected function unique(array $items = [], $visible = 2) {
  $items = array_chunk($items, $visible, TRUE);
  $columns = [];
  foreach ($items as $value) {
    $columns = array_merge($columns, array_unique($value));
  }
  return $columns;
}