You are here

public function GridStackPluginBase::setOptionset in GridStack 8.2

Sets the optionset.

1 call to GridStackPluginBase::setOptionset()
GridStackEnginePluginBase::build in src/GridStackEnginePluginBase.php
Alters GridStack build.

File

src/GridStackPluginBase.php, line 152

Class

GridStackPluginBase
Provides base class for all gridstack plugins.

Namespace

Drupal\gridstack

Code

public function setOptionset($optionset) {
  $this->optionset = is_string($optionset) ? GridStack::loadWithFallback($optionset) : $optionset;
  $this->breakpoints = $this->optionset
    ->breakpointsToArray();
  $this->columns = $this->optionset
    ->getColumns();
  $this->minWidth = (int) $this->optionset
    ->getSetting('minWidth', 481);
  $this->cellHeight = $this->optionset
    ->getSetting('cellHeight', 80);
  $this->verticalMargin = $this->optionset
    ->getSetting('verticalMargin', 0);
  return $this;
}