Skip to content

Commit

Permalink
Tweak: Added size units to Max Width control in Image widget closes e…
Browse files Browse the repository at this point in the history
  • Loading branch information
shilo-ey committed Jan 5, 2020
1 parent 11a72aa commit 6ba951e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions includes/widgets/image.php
Expand Up @@ -286,7 +286,7 @@ protected function _register_controls() {
$this->add_responsive_control(
'space',
[
'label' => __( 'Max Width', 'elementor' ) . ' (%)',
'label' => __( 'Max Width', 'elementor' ),
'type' => Controls_Manager::SLIDER,
'default' => [
'unit' => '%',
Expand All @@ -297,12 +297,20 @@ protected function _register_controls() {
'mobile_default' => [
'unit' => '%',
],
'size_units' => [ '%' ],
'size_units' => [ '%', 'px', 'vw' ],
'range' => [
'%' => [
'min' => 1,
'max' => 100,
],
'px' => [
'min' => 1,
'max' => 1000,
],
'vw' => [
'min' => 1,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .elementor-image img' => 'max-width: {{SIZE}}{{UNIT}};',
Expand Down

0 comments on commit 6ba951e

Please sign in to comment.