| @@ -6,8 +6,9 @@ | ||
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | use ABlocks\Classes\BlockBaseAbstract; |
| 9 | 9 | use ABlocks\Classes\CssGenerator; |
| 10 | +use ABlocks\Controls\Color; | |
| 10 | 11 | |
| 11 | 12 | class Block extends BlockBaseAbstract { |
| 12 | 13 | protected $parent_block_name = 'table'; |
| 13 | 14 | protected $block_name = 'table-row'; |
| @@ -30,19 +31,16 @@ | ||
| 30 | 31 | } |
| 31 | 32 | |
| 32 | 33 | public function get_row_css( $attributes, $device = '' ) { |
| 33 | 34 | $css = []; |
| 34 | - if ( ! empty( $attributes['rowColor'] ) ) { | |
| 35 | - $css['background'] = $attributes['rowColor'] . ' !important'; | |
| 36 | - } | |
| 37 | - | |
| 35 | + $css['background'] = Color::get_css( | |
| 36 | + isset( $attributes['rowColor'] ) ? $attributes['rowColor'] : '') . ' !important'; | |
| 38 | 37 | return $css; |
| 39 | 38 | } |
| 40 | 39 | public function get_row_hover_css( $attributes, $device = '' ) { |
| 41 | 40 | $css = []; |
| 42 | - if ( ! empty( $attributes['rowColorH'] ) ) { | |
| 43 | - $css['background'] = $attributes['rowColorH'] . ' !important'; | |
| 44 | - } | |
| 41 | + $css['background'] = Color::get_css( | |
| 42 | + isset( $attributes['rowColorH'] ) ? $attributes['rowColorH'] : '') . ' !important'; | |
| 45 | 43 | |
| 46 | 44 | return $css; |
| 47 | 45 | } |
| 48 | 46 | } |