| @@ -62,8 +62,14 @@ | ||
| 62 | 62 | */ |
| 63 | 63 | public $parallax; |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | + * @var Common\KenBurns|null | |
| 67 | + */ | |
| 68 | + public $kenBurns; | |
| 69 | + | |
| 70 | + | |
| 71 | + /** | |
| 66 | 72 | * @var Common\DataSourceOptions|null |
| 67 | 73 | */ |
| 68 | 74 | public $dataSource = null; |
| 69 | 75 | |
| @@ -162,9 +168,9 @@ | ||
| 162 | 168 | protected function renderDataSource() { |
| 163 | 169 | $sectionMarkup = ''; |
| 164 | 170 | $dataSourceInstance = \Depicter::dataSource()->getByType( $this->dataSource->type ); |
| 165 | 171 | if( $dataSourceInstance ){ |
| 166 | - $dataSheets = $dataSourceInstance->getRecordsWithTags( $this->dataSource->params ); | |
| 172 | + $dataSheets = $dataSourceInstance->getDataSheetArgs( $this->dataSource->params ); | |
| 167 | 173 | foreach( $dataSheets as $dataSheet ){ |
| 168 | 174 | $this->setDataSheet( $dataSheet ); |
| 169 | 175 | $sectionMarkup .= $this->renderStatic(); |
| 170 | 176 | } |
| @@ -188,12 +194,20 @@ | ||
| 188 | 194 | if ( !empty( $this->wrapperSize ) ) { |
| 189 | 195 | $sectionWidth = $this->wrapperSize->getResponsiveSizes( "width" ); |
| 190 | 196 | if ( ! $this->wrapperSize->hasNoResponsiveSize( $sectionWidth ) ) { |
| 191 | 197 | $args[ 'data-wrapper-width'] = implode( ',', $sectionWidth ); |
| 198 | + $args[ 'data-wrapper-width'] = str_replace( 'auto', '', $args[ 'data-wrapper-width'] ); | |
| 199 | + if ( $args[ 'data-wrapper-width'] == ',,' ) { | |
| 200 | + unset( $args[ 'data-wrapper-width'] ); | |
| 201 | + } | |
| 192 | 202 | } |
| 193 | 203 | $sectionHeight = $this->wrapperSize->getResponsiveSizes( "height" ); |
| 194 | 204 | if ( ! $this->wrapperSize->hasNoResponsiveSize( $sectionHeight ) ) { |
| 195 | 205 | $args['data-wrapper-height'] = implode( ',', $sectionHeight ); |
| 206 | + $args[ 'data-wrapper-height'] = str_replace( 'auto', '', $args[ 'data-wrapper-height'] ); | |
| 207 | + if ( $args[ 'data-wrapper-height'] == ',,' ) { | |
| 208 | + unset( $args[ 'data-wrapper-height'] ); | |
| 209 | + } | |
| 196 | 210 | } |
| 197 | 211 | } |
| 198 | 212 | |
| 199 | 213 | if ( !empty( $this->options ) ) { |
| @@ -235,8 +249,13 @@ | ||
| 235 | 249 | } |
| 236 | 250 | } |
| 237 | 251 | if( $sectionBackground = $this->background->render() ){ |
| 238 | 252 | $this->background->setDataSheet( $this->getDataSheet() ); |
| 253 | + | |
| 254 | + if ( $this->kenBurns && false !== $kenBurnsData = $this->kenBurns->getKenBurnsAttrs() ) { | |
| 255 | + $this->background->setKenBurnsData( $kenBurnsData ); | |
| 256 | + } | |
| 257 | + | |
| 239 | 258 | $div->nest( "\n" . $this->background->render() . "\n\n" ); |
| 240 | 259 | } |
| 241 | 260 | |
| 242 | 261 | $this->styleList = Arr::merge( $this->styleList, $this->getSelectorAndCssList() ); |
| @@ -405,11 +424,13 @@ | ||
| 405 | 424 | */ |
| 406 | 425 | protected function getSelectorAndCssList(){ |
| 407 | 426 | $styleList = []; |
| 408 | 427 | |
| 409 | - $styleList[ '.' . $this->getStyleSelector() ] = $this->background->getColor(); | |
| 428 | + $styleList[ '.' . $this->getStyleSelector() . ' .' . $this->background->getContainerClassName() ] = array_merge_recursive( | |
| 429 | + $this->background->getColor(), | |
| 430 | + $this->background->getSectionBackgroundFilter() | |
| 431 | + ); | |
| 410 | 432 | $styleList[ '.' . $this->getStyleSelector() . ' .' . $this->background->getContainerClassName() . '::after' ] = $this->background->getOverlayStyles(); |
| 411 | - $styleList[ '.' . $this->getStyleSelector() . ' .' . $this->background->getContainerClassName() ] = $this->background->getSectionBackgroundFilter(); | |
| 412 | 433 | |
| 413 | 434 | if ( $this->getCustomStyles() ) { |
| 414 | 435 | $styleList[ '.' . $this->getStyleSelector() ]['customStyle'] = $this->getCustomStyles(); |
| 415 | 436 | } |