Skip to content

Commit

Permalink
Merge branch 'release/1.5.4' of github.com:pojome/elementor into rele…
Browse files Browse the repository at this point in the history
…ase/1.5.4
  • Loading branch information
KingYes committed Jul 17, 2017
2 parents 87c9610 + 97094cb commit 63106fc
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 1 deletion.
Binary file modified assets/images/placeholder.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion includes/base/controls-stack.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ public function add_control( $id, array $args, $overwrite = false ) {
if ( ! empty( $args['section'] ) || ! empty( $args['tab'] ) ) {
_doing_it_wrong( __CLASS__ . '::' . __FUNCTION__, 'Cannot redeclare control with `tab` or `section` args inside section. - ' . $id, '1.0.0' );
}

$args = array_merge( $args, $this->_current_section );

if ( null !== $this->_current_tab ) {
$args = array_merge( $args, $this->_current_tab );
}
} elseif ( empty( $args['section'] ) ) {
wp_die( __CLASS__ . '::' . __FUNCTION__ . ': Cannot add a control outside a section (use `start_controls_section`).' );
wp_die( __CLASS__ . '::' . __FUNCTION__ . ': Cannot add a control outside of a section (use `start_controls_section`).' );
}
}

Expand Down
38 changes: 38 additions & 0 deletions includes/controls/checkbox.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
namespace Elementor;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
* A single Checkbox control
*
* @param string $default Whether to initial it as checked. 'on' for checked, and '' (empty string) for unchecked
* Default ''
* @deprecated since 1.5.4
*
* @since 1.0.0
*/
class Control_Checkbox extends Base_Data_Control {

public function get_type() {
return 'checkbox';
}

public function get_value( $control, $widget ) {
_deprecated_file( __CLASS__, '1.5.4' );

return parent::get_value( $control, $widget );
}

public function content_template() {
?>
<label class="elementor-control-title">
<input type="checkbox" data-setting="{{ data.name }}" />
<span>{{{ data.label }}}</span>
</label>
<# if ( data.description ) { #>
<div class="elementor-control-field-description">{{{ data.description }}}</div>
<# } #>
<?php
}
}
7 changes: 7 additions & 0 deletions includes/managers/controls.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ class Controls_Manager {
const HOVER_ANIMATION = 'hover_animation';
const ORDER = 'order';

/**
* @deprecated since 1.5.4
*/
const CHECKBOX = 'checkbox';

/**
* @var Base_Control[]
*/
Expand Down Expand Up @@ -123,6 +128,8 @@ private function register_controls() {
self::ANIMATION,
self::HOVER_ANIMATION,
self::ORDER,

self::CHECKBOX,
];

foreach ( $available_controls as $control_id ) {
Expand Down
5 changes: 5 additions & 0 deletions includes/preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function init() {
add_filter( 'show_admin_bar', '__return_false' );

add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_styles' ] );
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
add_action( 'wp_head', [ $this, 'print_custom_css' ] );
add_filter( 'the_content', [ $this, 'builder_wrapper' ], 999999 );

Expand Down Expand Up @@ -110,6 +111,10 @@ public function enqueue_styles() {
do_action( 'elementor/preview/enqueue_styles' );
}

public function enqueue_scripts() {
do_action( 'elementor/preview/enqueue_scripts' );
}

/**
* Preview constructor.
*
Expand Down
6 changes: 6 additions & 0 deletions includes/widgets/divider.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ protected function _register_controls() {
'size' => 100,
'unit' => '%',
],
'tablet_default' => [
'unit' => '%',
],
'mobile_default' => [
'unit' => '%',
],
'selectors' => [
'{{WRAPPER}} .elementor-divider-separator' => 'width: {{SIZE}}{{UNIT}};',
],
Expand Down
6 changes: 6 additions & 0 deletions includes/widgets/image-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ protected function _register_controls() {
'size' => 30,
'unit' => '%',
],
'tablet_default' => [
'unit' => '%',
],
'mobile_default' => [
'unit' => '%',
],
'size_units' => [ '%' ],
'range' => [
'%' => [
Expand Down
6 changes: 6 additions & 0 deletions includes/widgets/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ protected function _register_controls() {
'size' => 100,
'unit' => '%',
],
'tablet_default' => [
'unit' => '%',
],
'mobile_default' => [
'unit' => '%',
],
'size_units' => [ '%' ],
'range' => [
'%' => [
Expand Down
6 changes: 6 additions & 0 deletions includes/widgets/social-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ protected function _register_controls() {
'default' => [
'unit' => 'em',
],
'tablet_default' => [
'unit' => 'em',
],
'mobile_default' => [
'unit' => 'em',
],
'range' => [
'em' => [
'min' => 0,
Expand Down

0 comments on commit 63106fc

Please sign in to comment.