protected function GridStackBase::nodeAttributes in GridStack 8.2
1 call to GridStackBase::nodeAttributes()
- GridStackBase::itemAttributes in src/Plugin/gridstack/engine/GridStackBase.php
- Modifies the .box attributes.
File
- src/Plugin/gridstack/engine/GridStackBase.php, line 85
Class
- GridStackBase
- Provides the base class for two-dimensional layout engines.
Namespace
Drupal\gridstack\Plugin\gridstack\engine
Code
protected function nodeAttributes(array &$attributes, array $node) {
$ns = $this
->getSetting('nameshort', 'gs');
foreach ($this->nodes as $key) {
if (isset($node[$key])) {
if ($key == 'region' && $node[$key]) {
$attributes['class'][] = 'box--' . Html::cleanCssIdentifier($node[$key]);
}
else {
$attributes['data-' . $ns . '-' . $key] = (int) $node[$key];
}
}
}
}