| 1 |
<?php |
| 2 |
namespace Depicter\Document\Models\Elements; |
| 3 |
|
| 4 |
use Depicter\Html\Html; |
| 5 |
|
| 6 |
class Arrow extends Svg { |
| 7 |
|
| 8 |
/** |
| 9 |
* Render arrow markup |
| 10 |
* |
| 11 |
* @return \TypeRocket\Html\Html|void |
| 12 |
* @throws \JsonMapper_Exception |
| 13 |
*/ |
| 14 |
public function render() { |
| 15 |
$args = $this->getDefaultAttributes(); |
| 16 |
return Html::div( $args, "\n" . $this->options->content . "\n" ); |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Get svg selector |
| 21 |
* |
| 22 |
* @return string |
| 23 |
*/ |
| 24 |
public function getSvgSelector() { |
| 25 |
return '.' . $this->getSelector() . ' .depicter-arrow-icon'; |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Get list of selector and CSS for element |
| 30 |
* |
| 31 |
* @return array |
| 32 |
* @throws \JsonMapper_Exception |
| 33 |
*/ |
| 34 |
public function getSelectorAndCssList(){ |
| 35 |
$this->selectorCssList = parent::getSelectorAndCssList(); |
| 36 |
if ( !empty( $this->selectorCssList[ $this->getSvgSelector() ]['hover'] ) ) { |
| 37 |
$this->selectorCssList[ '.' . $this->getSelector() . ':not(.depicter-hover-off):hover .depicter-arrow-icon'] = $this->selectorCssList[ $this->getSvgSelector() ]['hover']; |
| 38 |
|
| 39 |
$transition = $this->prepare()->styles->getTransitionCss(); |
| 40 |
if ( !empty( $transition ) ) { |
| 41 |
$this->selectorCssList[ $this->getSvgSelector() ] = array_merge_recursive( $this->selectorCssList[ $this->getSvgSelector() ], $transition ); |
| 42 |
} |
| 43 |
|
| 44 |
unset( $this->selectorCssList[ $this->getSvgSelector() ]['hover'] ); |
| 45 |
} |
| 46 |
return $this->selectorCssList; |
| 47 |
} |
| 48 |
} |
| 49 |
|