Skip to content
Snippets Groups Projects
Commit 3063d74a authored by Gaus Surahman's avatar Gaus Surahman
Browse files

- Minor fixes.

parent 5d3bae2e
Branches
Tags
No related merge requests found
......@@ -4,11 +4,11 @@
*/
/* Fixed for gigantic layout thumbnails due to off-canvas reset. */
#drupal-off-canvas a[href*="gridstack"] img {
#drupal-off-canvas a[href*="gridstack"] img { /* csslint allow: ids */
height: auto;
max-width: 100%;
}
#drupal-off-canvas input[disabled] {
#drupal-off-canvas input[disabled] { /* csslint allow: ids */
cursor: not-allowed;
}
......@@ -43,8 +43,9 @@ plugin.
debug errors.)
### Note:
* GridStack 8.x-2.9+ and DEV versions require library v5 and Blazy:2.10.
* GridStack 8.x-2.6+ and DEV versions require a minimum v4+ or v5.
* GridStack 8.x-2.10+ and DEV versions require library v5 and Blazy:2.16+.
* GridStack 8.x-2.9+ requires library v5 and Blazy:2.10+.
* GridStack 8.x-2.6+ requires a minimum v4+ or v5.
* GridStack 8.x-2.5 below require a minimum v1.1+ (deprecated).
* GridStack 8.x-2.4 below requires a maximum v0.5.3 below (deprecated).
* GridStack 8.x-1.0-beta4 below requires v0.2.5 (deprecated).
......@@ -52,14 +53,16 @@ plugin.
***
***
# <a name="installing-library"> </a>INSTALLING LIBRARY
Applicable since v4/v5, installing library may be done in several ways:
Adjust the supported versions as per [REQUIREMENTS](#requirements) above or
project home requirements for more updated info.
Applicable since `v4/v5`, installing library may be done in several ways:
* _With composer_:
`composer require npm-asset/gridstack`
Assumed using `asset-packagist`, see Blazy UI `/admin/help` for setup samples.
This will package the `gridstack/dist` folder automatically.
`composer require npm-asset/gridstack:^5.1.1`
Assumed using `asset-packagist`, see [Blazy UI](/admin/help/blazy_ui) for
setup samples. This will package the `gridstack/dist` folder automatically.
* _Without composer_:
`npm install --save gridstack`
`npm install --save gridstack@5.1.1`
This will package the `node_modules/gridstack/dist` folder automatically.
Be sure to exclude `node_modules` folder when moving into `libraries` folder,
just take out `gridstack` folder.
......
......@@ -389,12 +389,12 @@ abstract class GridStackEnginePluginBase extends GridStackPluginBase implements
$this->itemContentAttributes($content_attributes, $settings);
// Provides nested items if so configured.
if ($config->use('nested')) {
if ($config->get('use.nested')) {
$this->modifyNestedItem($delta, $settings, $content, $attributes, $content_attributes, $regions);
}
// Allows stylizer to modify contents and attributes.
if ($config->use('stylizer')) {
if ($config->get('use.stylizer')) {
$this->stylizer->modifyItem($delta, $settings, $content, $attributes, $content_attributes, $regions);
}
}
......@@ -446,7 +446,7 @@ abstract class GridStackEnginePluginBase extends GridStackPluginBase implements
$config = &$settings['gridstacks'];
$dummy = $config->is('dummy') ?: ($settings['_dummy'] ?? FALSE);
$use_inner = $config->use('inner') ?: ($settings['use_inner'] ?? FALSE);
$use_inner = $config->get('use.inner') ?: ($settings['use_inner'] ?? FALSE);
$config->set('is.dummy', $dummy)
->set('use.inner', $use_inner);
......@@ -610,7 +610,7 @@ abstract class GridStackEnginePluginBase extends GridStackPluginBase implements
$config = $settings['gridstacks'];
// Bail out if not configurable via Layout Builder alike.
if ($config->use('stylizer')) {
if ($config->get('use.stylizer')) {
$this->stylizer->attributes($attributes, $settings);
// Provides styles per item to be aggregated at top level.
......
......@@ -212,7 +212,7 @@ class GridStackManager extends BlazyManagerBase implements GridStackManagerInter
$engine = $settings['_engine'] ?? '';
$engine = $engine ?: $gridstacks->get('engine');
$gridnative = $settings['gridnative'] ?? '';
$gridnative = $gridnative ?: $gridstacks->use('gridnative');
$gridnative = $gridnative ?: $gridstacks->get('use.gridnative');
$column = $optionset->getSetting('column', 12);
$ungridstack = $settings['ungridstack'] ?? FALSE;
$ungridstack = $ungridstack ?: $gridstacks->is('ungridstack');
......
......@@ -26,7 +26,7 @@ abstract class GridStackBase extends GridStackEnginePluginBase {
// Only load libraries if not destroyed, nor using Bootstrap/ Foundation.
$config = $attach['gridstacks'];
if ($config->use('gridstack')) {
if ($config->get('use.gridstack')) {
$load['drupalSettings']['gridstack'] = GridStack::defaultSettings();
}
}
......@@ -39,7 +39,7 @@ abstract class GridStackBase extends GridStackEnginePluginBase {
// Provides dummy item to fix layout aspect ratio.
$config = $attach['gridstacks'];
if ($config->use('gridstack')) {
if ($config->get('use.gridstack')) {
$build['postscript']['dummy'] = $this->buildDummyItem();
}
}
......@@ -139,7 +139,7 @@ abstract class GridStackBase extends GridStackEnginePluginBase {
}
// Use the customized gridstack static without dnd if so configured.
if ($config->use('gridstatic') && !$config->use('gridnative')) {
if ($config->get('use.gridstatic') && !$config->get('use.gridnative')) {
$attributes['class'][] = 'gridstack--static';
}
......
......@@ -33,7 +33,7 @@ class GridStackJs extends GridStackBase {
// Allows to not use GridStack libraries, yet still re-use the same markups.
$config = $attach['gridstacks'];
if ($config->use('gridstack')) {
if ($config->get('use.gridstack')) {
$load['library'][] = 'gridstack/load';
$column = $config->get('column');
......
......@@ -154,7 +154,7 @@ class GridStackStylizer extends GridStackPluginManagerBase implements GridStackS
*/
public function attach(array &$load, array $attach = []) {
$config = $attach['gridstacks'];
if ($config->use('stylizer')) {
if ($config->get('use.stylizer')) {
$load['library'][] = 'gridstack/stylizer';
$this->setAttachments($load, $attach);
......
......@@ -43,8 +43,8 @@ function template_preprocess_gridstack_box(&$variables) {
$settings = &$variables['settings'];
$config = $settings['gridstacks'];
$nested_id = $config->get('nested.id');
$use_inner = $config->use('inner');
$use_fw = $config->use('framework');
$use_inner = $config->get('use.inner');
$use_fw = $config->get('use.framework');
$root_delta = $config->get('root.delta');
// Boxes may have captions.
......@@ -108,7 +108,7 @@ function template_preprocess_gridstack_box(&$variables) {
// Prevents collapsing container without media/ images.
// Re-uses the same .is-gs-ratio class for ungridstack, not needed by native.
if ($config->use('js')) {
if ($config->get('use.js')) {
$variables['content_attributes']['class'][] = 'grid-stack-item-content';
$caption_only = empty($item['box']) && !empty($item['caption']);
if ($caption_only || $config->is('ungridstack')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment