adds width option in percentage

This commit is contained in:
buttle 2021-10-06 13:04:26 +02:00
parent ea50a69804
commit 101a016e9e
2 changed files with 12 additions and 7 deletions

View File

@ -22,6 +22,13 @@ class Module extends AbstractModule
*/ */
]; ];
const MODEL_WIDTH = [
'50' => '50 %',
'75' => '75 %',
'100' => '100 %',
];
public function getConfig() public function getConfig()
{ {
return include __DIR__ . '/config/module.config.php'; return include __DIR__ . '/config/module.config.php';

View File

@ -22,12 +22,10 @@ class Render3DBlockForm extends Form
$this->add([ $this->add([
'name' => 'o:block[__blockIndex__][o:data][width]', 'name' => 'o:block[__blockIndex__][o:data][width]',
'type' => Element\Number::class, 'type' => Element\Select::class,
'options' => [ 'options' => [
'label' => 'Width in pixels', 'label' => 'Width',
], 'value_options' => Module::MODEL_WIDTH,
'attributes' => [
'min' => '100',
], ],
]); ]);