feat(main: Added default block classes
This commit is contained in:
@@ -152,8 +152,11 @@ trait DisplayHooks
|
||||
} else {
|
||||
$config['breakpoints'] = [
|
||||
768 => ['slidesPerView' => (float) $block['slides_per_view_tablet']],
|
||||
992 => ['slidesPerView' => (float) $block['slides_per_view_desktop']],
|
||||
];
|
||||
|
||||
if ((float) $block['slides_per_view_desktop'] > 0) {
|
||||
$config['breakpoints'][992] = ['slidesPerView' => (float) $block['slides_per_view_desktop']];
|
||||
}
|
||||
}
|
||||
|
||||
if ((int) $block['autoplay_delay'] > 0) {
|
||||
@@ -167,8 +170,12 @@ trait DisplayHooks
|
||||
return json_encode($config);
|
||||
}
|
||||
|
||||
private function buildSliderDesktopColumnWidth(array $block): string
|
||||
private function buildSliderDesktopColumnWidth(array $block): ?string
|
||||
{
|
||||
if ((float) $block['slides_per_view_desktop'] <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$columns = max(1, (int) round((float) $block['slides_per_view_desktop']));
|
||||
|
||||
return round(100 / $columns, 4) . '%';
|
||||
|
||||
@@ -51,6 +51,7 @@ trait Install
|
||||
`hook_name` VARCHAR(64) NOT NULL,
|
||||
`title` VARCHAR(256) NOT NULL DEFAULT \'\',
|
||||
`custom_class` VARCHAR(128) NOT NULL DEFAULT \'\',
|
||||
`default_block_class` VARCHAR(128) NOT NULL DEFAULT \'\',
|
||||
`active` TINYINT(1) NOT NULL DEFAULT 1,
|
||||
`ordering` INT(11) NOT NULL DEFAULT 0,
|
||||
`date_add` DATETIME NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user