mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
FIX: Slider size on missing owner element
This commit is contained in:
parent
38f2098255
commit
142fc48b00
@ -9,6 +9,7 @@
|
||||
|
||||
namespace A2nt\CMSNiceties\Extensions;
|
||||
|
||||
use A2nt\ElementalBasics\Elements\SliderElement;
|
||||
use SilverStripe\Forms\CheckboxField;
|
||||
use SilverStripe\Forms\DatetimeField;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
@ -37,12 +38,20 @@ class SlideImageExtension extends DataExtension
|
||||
public function getSlideWidth()
|
||||
{
|
||||
$element = $this->getElement();
|
||||
if(!$element->ID) {
|
||||
return SliderElement::config()->get('slide_width');
|
||||
}
|
||||
|
||||
return $element->getSlideWidth();
|
||||
}
|
||||
|
||||
public function getSlideHeight()
|
||||
{
|
||||
$element = $this->getElement();
|
||||
if(!$element->ID) {
|
||||
return SliderElement::config()->get('slide_height');
|
||||
}
|
||||
|
||||
return $element->getSlideHeight();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user