← All changes
|
core/kits/documents/tabs/settings-layout.php
+9
-16
4.3.0-beta3
→
3.19.2
View file →
| @@ -8,9 +8,9 @@ | ||
| 8 | 8 | use Elementor\Core\Base\Document; |
| 9 | 9 | use Elementor\Modules\PageTemplates\Module as PageTemplatesModule; |
| 10 | 10 | |
| 11 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | - exit; // Exit if accessed directly. | |
| 12 | + exit; // Exit if accessed directly | |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | class Settings_Layout extends Tab_Base { |
| 16 | 16 | |
| @@ -79,8 +79,10 @@ | ||
| 79 | 79 | ] |
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | 82 | $is_container_active = Plugin::instance()->experiments->is_feature_active( 'container' ); |
| 83 | + $logical_dimensions_inline_start = is_rtl() ? '{{RIGHT}}{{UNIT}}' : '{{LEFT}}{{UNIT}}'; | |
| 84 | + $logical_dimensions_inline_end = is_rtl() ? '{{LEFT}}{{UNIT}}' : '{{RIGHT}}{{UNIT}}'; | |
| 83 | 85 | |
| 84 | 86 | if ( $is_container_active ) { |
| 85 | 87 | $this->add_responsive_control( |
| 86 | 88 | 'container_padding', |
| @@ -89,9 +91,9 @@ | ||
| 89 | 91 | 'type' => Controls_Manager::DIMENSIONS, |
| 90 | 92 | 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], |
| 91 | 93 | 'description' => esc_html__( 'Sets the default space inside the container (Default is 10px)', 'elementor' ), |
| 92 | 94 | 'selectors' => [ |
| 93 | - '.e-con' => '--container-default-padding-top: {{TOP}}{{UNIT}}; --container-default-padding-right: {{RIGHT}}{{UNIT}}; --container-default-padding-bottom: {{BOTTOM}}{{UNIT}}; --container-default-padding-left: {{LEFT}}{{UNIT}};', | |
| 95 | + '.e-con' => "--container-default-padding-block-start: {{TOP}}{{UNIT}}; --container-default-padding-inline-end: $logical_dimensions_inline_end; --container-default-padding-block-end: {{BOTTOM}}{{UNIT}}; --container-default-padding-inline-start: $logical_dimensions_inline_start;", | |
| 94 | 96 | ], |
| 95 | 97 | ] |
| 96 | 98 | ); |
| 97 | 99 | } |
| @@ -115,9 +117,12 @@ | ||
| 115 | 117 | 'row' => '20', |
| 116 | 118 | 'column' => '20', |
| 117 | 119 | ], |
| 118 | 120 | 'description' => esc_html__( 'Sets the default space between widgets (Default: 20px)', 'elementor' ), |
| 119 | - 'selectors' => $this->get_spacing_selectors(), | |
| 121 | + 'selectors' => [ | |
| 122 | + '.elementor-widget:not(:last-child)' => 'margin-block-end: {{ROW}}{{UNIT}}', | |
| 123 | + '.elementor-element' => '--widgets-spacing: {{ROW}}{{UNIT}} {{COLUMN}}{{UNIT}}', | |
| 124 | + ], | |
| 120 | 125 | 'conversion_map' => [ |
| 121 | 126 | 'old_key' => 'size', |
| 122 | 127 | 'new_key' => 'column', |
| 123 | 128 | ], |
| @@ -242,20 +247,8 @@ | ||
| 242 | 247 | |
| 243 | 248 | $this->end_controls_section(); |
| 244 | 249 | } |
| 245 | 250 | |
| 246 | - private function get_spacing_selectors(): array { | |
| 247 | - $optimized_markup = Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 248 | - $sections_widget_spacing = $optimized_markup | |
| 249 | - ? '--kit-widget-spacing: {{ROW}}{{UNIT}}' | |
| 250 | - : 'margin-block-end: {{ROW}}{{UNIT}}'; | |
| 251 | - | |
| 252 | - return [ | |
| 253 | - '.elementor-widget:not(:last-child)' => $sections_widget_spacing, | |
| 254 | - '.elementor-element' => '--widgets-spacing: {{ROW}}{{UNIT}} {{COLUMN}}{{UNIT}};--widgets-spacing-row: {{ROW}}{{UNIT}};--widgets-spacing-column: {{COLUMN}}{{UNIT}};', | |
| 255 | - ]; | |
| 256 | - } | |
| 257 | - | |
| 258 | 251 | /** |
| 259 | 252 | * Before Save |
| 260 | 253 | * |
| 261 | 254 | * Runs Before the Kit document is saved. |
| @@ -332,9 +325,8 @@ | ||
| 332 | 325 | 'breakpoint_' . $breakpoint_key . '_heading', |
| 333 | 326 | [ |
| 334 | 327 | 'label' => $default_breakpoint_config['label'], |
| 335 | 328 | 'type' => Controls_Manager::HEADING, |
| 336 | - 'separator' => 'before', | |
| 337 | 329 | 'conditions' => [ |
| 338 | 330 | 'terms' => [ |
| 339 | 331 | [ |
| 340 | 332 | 'name' => 'active_breakpoints', |
| @@ -350,8 +342,9 @@ | ||
| 350 | 342 | 'label' => esc_html__( 'Breakpoint', 'elementor' ) . ' (px)', |
| 351 | 343 | 'type' => Controls_Manager::NUMBER, |
| 352 | 344 | 'placeholder' => $default_breakpoint_config['default_value'], |
| 353 | 345 | 'frontend_available' => true, |
| 346 | + 'separator' => 'after', | |
| 354 | 347 | 'validators' => [ |
| 355 | 348 | 'Breakpoint' => [ |
| 356 | 349 | 'breakpointName' => $breakpoint_key, |
| 357 | 350 | ], |