| @@ -85,31 +85,9 @@ | ||
| 85 | 85 | public function get_keywords() { |
| 86 | 86 | return [ 'space' ]; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - protected function is_dynamic_content(): bool { | |
| 90 | - return false; | |
| 91 | - } | |
| 92 | - | |
| 93 | 89 | /** |
| 94 | - * Get style dependencies. | |
| 95 | - * | |
| 96 | - * Retrieve the list of style dependencies the widget requires. | |
| 97 | - * | |
| 98 | - * @since 3.24.0 | |
| 99 | - * @access public | |
| 100 | - * | |
| 101 | - * @return array Widget style dependencies. | |
| 102 | - */ | |
| 103 | - public function get_style_depends(): array { | |
| 104 | - return [ 'widget-spacer' ]; | |
| 105 | - } | |
| 106 | - | |
| 107 | - public function has_widget_inner_wrapper(): bool { | |
| 108 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 109 | - } | |
| 110 | - | |
| 111 | - /** | |
| 112 | 90 | * Register spacer widget controls. |
| 113 | 91 | * |
| 114 | 92 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 115 | 93 | * |
| @@ -131,24 +109,34 @@ | ||
| 131 | 109 | 'type' => Controls_Manager::SLIDER, |
| 132 | 110 | 'default' => [ |
| 133 | 111 | 'size' => 50, |
| 134 | 112 | ], |
| 135 | - 'size_units' => [ 'px', 'em', 'rem', 'vh', 'custom' ], | |
| 113 | + 'size_units' => [ 'px', 'vh', 'em' ], | |
| 136 | 114 | 'range' => [ |
| 137 | 115 | 'px' => [ |
| 116 | + 'min' => 10, | |
| 138 | 117 | 'max' => 600, |
| 139 | 118 | ], |
| 140 | 119 | 'em' => [ |
| 120 | + 'min' => 0.1, | |
| 141 | 121 | 'max' => 20, |
| 142 | 122 | ], |
| 143 | 123 | ], |
| 144 | - 'render_type' => 'template', | |
| 145 | 124 | 'selectors' => [ |
| 146 | - '{{WRAPPER}}' => '--spacer-size: {{SIZE}}{{UNIT}};', | |
| 125 | + '{{WRAPPER}} .elementor-spacer-inner' => '--spacer-size: {{SIZE}}{{UNIT}};', | |
| 147 | 126 | ], |
| 148 | 127 | ] |
| 149 | 128 | ); |
| 150 | 129 | |
| 130 | + $this->add_control( | |
| 131 | + 'view', | |
| 132 | + [ | |
| 133 | + 'label' => esc_html__( 'View', 'elementor' ), | |
| 134 | + 'type' => Controls_Manager::HIDDEN, | |
| 135 | + 'default' => 'traditional', | |
| 136 | + ] | |
| 137 | + ); | |
| 138 | + | |
| 151 | 139 | $this->end_controls_section(); |
| 152 | 140 | } |
| 153 | 141 | |
| 154 | 142 | /** |
| @@ -159,13 +147,8 @@ | ||
| 159 | 147 | * @since 1.0.0 |
| 160 | 148 | * @access protected |
| 161 | 149 | */ |
| 162 | 150 | protected function render() { |
| 163 | - $settings = $this->get_settings_for_display(); | |
| 164 | - | |
| 165 | - if ( empty( $settings['space'] ) || empty( $settings['space']['size'] ) || 0 === $settings['space']['size'] ) { | |
| 166 | - return; | |
| 167 | - } | |
| 168 | 151 | ?> |
| 169 | 152 | <div class="elementor-spacer"> |
| 170 | 153 | <div class="elementor-spacer-inner"></div> |
| 171 | 154 | </div> |
| @@ -181,19 +164,10 @@ | ||
| 181 | 164 | * @access protected |
| 182 | 165 | */ |
| 183 | 166 | protected function content_template() { |
| 184 | 167 | ?> |
| 185 | - <# | |
| 186 | - if ( '' === settings.space || '' === settings.space.size || 0 === settings.space.size ) { | |
| 187 | - return; | |
| 188 | - } | |
| 189 | - #> | |
| 190 | 168 | <div class="elementor-spacer"> |
| 191 | 169 | <div class="elementor-spacer-inner"></div> |
| 192 | 170 | </div> |
| 193 | 171 | <?php |
| 194 | - } | |
| 195 | - | |
| 196 | - public function render_markdown(): string { | |
| 197 | - return ''; | |
| 198 | 172 | } |
| 199 | 173 | } |