Skip to content

Commit 615bdb4

Browse files
jyotibansal461actuallyakash
authored andcommitted
image alignment issue fixed
1 parent fae80c6 commit 615bdb4

1 file changed

Lines changed: 39 additions & 5 deletions

File tree

widgets/howto.php

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,7 +2175,7 @@ protected function register_controls() {
21752175
'default' => 'center',
21762176
'toggle' => true,
21772177
'selectors' => [
2178-
'{{WRAPPER}} .mt-how-to-step-image' => 'align-self: {{VALUES}}'
2178+
'{{WRAPPER}} .mt-has-img' => 'align-items: {{VALUES}}'
21792179
]
21802180
]
21812181
);
@@ -2204,6 +2204,43 @@ protected function register_controls() {
22042204
'unit' => '%',
22052205
'size' => 30,
22062206
],
2207+
'condition' => [
2208+
'step_image_alignment' => [ 'row-reverse', 'row' ]
2209+
],
2210+
'selectors' => [
2211+
'{{WRAPPER}} .mt-how-to-step-image' => 'width: {{SIZE}}{{UNIT}}',
2212+
'{{WRAPPER}} .mt-how-to-step-content' => 'width: (100% - {{SIZE}}{{UNIT}})',
2213+
],
2214+
]
2215+
);
2216+
2217+
$this->add_responsive_control(
2218+
'step_image_top_bottom_width',
2219+
[
2220+
'label' => __( 'Image Width', 'mighty' ),
2221+
'type' => Controls_Manager::SLIDER,
2222+
'size_units' => [ '%', 'px', 'em' ],
2223+
'range' => [
2224+
'%' => [
2225+
'min' => 1,
2226+
'max' => 100
2227+
],
2228+
'px' => [
2229+
'min' => 1,
2230+
'max' => 1000
2231+
],
2232+
'em' => [
2233+
'min' => 1,
2234+
'max' => 1000
2235+
]
2236+
],
2237+
'default' => [
2238+
'unit' => '%',
2239+
'size' => 30,
2240+
],
2241+
'condition' => [
2242+
'step_image_alignment' => [ 'column-reverse', 'column' ]
2243+
],
22072244
'selectors' => [
22082245
'{{WRAPPER}} .mt-how-to-step-image' => 'width: {{SIZE}}{{UNIT}}',
22092246
],
@@ -2438,9 +2475,6 @@ protected function render()
24382475
$this->add_render_attribute( 'mt-how-to-tools-title', 'class', 'mt-how-to-tools-title' );
24392476
$this->add_render_attribute( 'mt-how-to-step-title', 'class', 'mt-how-to-step-title' );
24402477
$this->add_render_attribute( 'mt-how-to-step-section-title', 'class', 'mt-how-to-step-section-title' );
2441-
if ( $settings['step_image_alignment'] == 'row' || $settings['step_image_alignment'] == 'row-reverse' ) {
2442-
$this->add_render_attribute( 'mt-how-to-step-content', 'style', 'width:calc(100% - '. $settings['step_image_width']['size'].'%);' );
2443-
}
24442478
$this->add_render_attribute( 'mt-how-to-step-content', 'class', 'mt-how-to-step-content' );
24452479
$this->add_render_attribute( 'mt-how-to-step', 'class', 'mt-how-to-step' );
24462480
$this->add_render_attribute( 'mt-how-to-step', 'class', 'mt-has-img' );
@@ -2555,7 +2589,7 @@ protected function render()
25552589
<?php } ?>
25562590

25572591
<<?php echo $settings['step_html_tag'];?> <?php echo $this->get_render_attribute_string('mt-how-to-step-title'); ?> ><?php echo $value['step_title'];?></<?php echo $settings['step_html_tag'];?> >
2558-
2592+
25592593
<?php if ( !empty($value['step_image_link']['url'] ) ) { ?>
25602594
</a>
25612595
<?php } ?>

0 commit comments

Comments
 (0)