code/Forms/ImageFormFactory.php 1 location
|
@@ 113-122 (lines=10) @@
|
110 |
|
$height = $record->getHeight(); |
111 |
|
} |
112 |
|
|
113 |
|
if ($width && $height) { |
114 |
|
$ratio = $width / $height; |
115 |
|
|
116 |
|
$dimensions->setSchemaComponent('ProportionConstraintField'); |
117 |
|
$dimensions->setSchemaState([ |
118 |
|
'data' => [ |
119 |
|
'ratio' => $ratio |
120 |
|
] |
121 |
|
]); |
122 |
|
} |
123 |
|
}); |
124 |
|
|
125 |
|
return parent::getForm($controller, $name, $context); |
code/Forms/RemoteFileFormFactory.php 1 location
|
@@ 241-250 (lines=10) @@
|
238 |
|
])->addExtraClass('flexbox-area-grow'), |
239 |
|
])->addExtraClass('insert-embed-modal__fields--fill-width'); |
240 |
|
|
241 |
|
if ($dimensions && $width && $height) { |
242 |
|
$ratio = $width / $height; |
243 |
|
|
244 |
|
$dimensions->setSchemaComponent('ProportionConstraintField'); |
245 |
|
$dimensions->setSchemaState([ |
246 |
|
'data' => [ |
247 |
|
'ratio' => $ratio |
248 |
|
] |
249 |
|
]); |
250 |
|
} |
251 |
|
return FieldList::create($fields); |
252 |
|
} |
253 |
|
} |