Active
Project:
Bootstrap Styles
Version:
1.0.3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Mar 2022 at 12:02 UTC
Updated:
17 Mar 2022 at 12:02 UTC
Jump to comment: Most recent
Some plugins - such as Border - have lots of options, and the developer might want to disable any of them.
For example, my design specs could say that there are no border-radius at all, so I won't need all the border-radius options.
I emptied the classes:

... but the UI still apears, which might be confusing to the user:

I think a nice feature could be to check for the absence of any defined style options and, if so, hide the UI
Something like this just works:
if ($this->getStyleOptionsCount('rounded_corners') > 0) {
$form['rounded_corners'] = [
'#type' => 'range',
'#title' => '<span class="sr-only">' . $this->t('Corners') . '</span><div class="bs_tooltip" data-placement="top" role="tooltip">' . $this->t('All Corners') . '</div>',
'#min' => 0,
'#max' => $this->getStyleOptionsCount('rounded_corners'),
'#step' => 1,
'#default_value' => $default_value,
'#validated' => TRUE,
'#attributes' => [
'class' => ['bs-field-rounded-corners'],
],
'#description' => $this->getSvgIconMarkup($icon_path . 'plugins/border/border-radius.svg'),
];
}
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot_20220317_130023.png | 6.95 KB | idiaz.roncero | |
| Screenshot_20220317_125902.png | 36.61 KB | idiaz.roncero |
Comments