protected function GridStackBase::itemAttributes in GridStack 8.2
Modifies the .box attributes.
Overrides GridStackEnginePluginBase::itemAttributes
File
- src/
Plugin/ gridstack/ engine/ GridStackBase.php, line 60
Class
- GridStackBase
- Provides the base class for two-dimensional layout engines.
Namespace
Drupal\gridstack\Plugin\gridstack\engineCode
protected function itemAttributes(array &$attributes, array &$settings) {
parent::itemAttributes($attributes, $settings);
$id = $this
->getSetting('delta', 0);
$nid = $this
->getSetting('nested_delta', -1);
$root = $this
->getSetting('_root', 'grids');
$grids = $this
->getSetting('_grids') ?: $this
->getOptionset()
->getLastBreakpoint($root);
// @todo nested grids for js-driven/ native Grid layouts, respects 0.
if (isset($settings['nested_delta']) && $root == 'nested') {
$node = isset($grids[$id][$nid]) ? $this
->getOptionset()
->getNode($grids[$id][$nid], FALSE) : [];
}
else {
// The root element grids.
$node = isset($grids[$id]) ? $this
->getOptionset()
->getNode($grids[$id], FALSE) : [];
}
if ($node) {
$this
->nodeAttributes($attributes, $node);
}
}