コード例 #1
0
 /**
  * {@inheritdoc}
  */
 protected function build(Definition $definition, \Model $model, DefinitionMapper $mapper, Filter $filter = null, Definition $parent = null)
 {
     parent::build($definition, $model, $mapper, $filter, $parent);
     /** @var Popup $definition */
     /** @var PopupModel $model */
     $this->deserializePoint('offset', $definition, $model);
     if ($model->autoPan) {
         $padding = array_map(function ($value) {
             return array_map('intval', trimsplit(',', $value));
         }, deserialize($model->autoPanPadding, true));
         if ($padding[0] === $padding[1]) {
             if (!empty($padding[0])) {
                 $definition->setAutoPanPadding($padding[0]);
             }
         } else {
             if ($padding[0]) {
                 $definition->setAutoPanPaddingTopLeft($padding[0]);
             }
             if ($padding[1]) {
                 $definition->setAutoPanPaddingBottomRight($padding[1]);
             }
         }
     }
     if (!$model->closeOnClick) {
         $definition->setCloseOnClick(false);
     }
 }