Skip to content

Commit

Permalink
Coding [2]
Browse files Browse the repository at this point in the history
  • Loading branch information
KingYes committed Jul 12, 2016
1 parent eb5d61e commit eac034a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
20 changes: 10 additions & 10 deletions includes/controls/box-shadow.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public function get_default_value() {
return [
'horizontal' => 0,
'vertical' => 0,
'blur' => 0,
'blur' => 10,
'spread' => 0,
'inset' => '',
'shadow' => '',
'color' => 'rgba(0,0,0,0.5)',
];
}

Expand All @@ -32,22 +32,22 @@ public function get_sliders() {
public function content_template() {
?>
<%
var defaultValue = '';
var defaultColorValue = '';

if ( data.default ) {
if ( '#' !== data.default.substring( 0, 1 ) ) {
defaultValue = '#' + data.default;
if ( data.default.color ) {
if ( '#' !== data.default.color.substring( 0, 1 ) ) {
defaultColorValue = '#' + data.default.color;
} else {
defaultValue = data.default;
defaultColorValue = data.default.color;
}

defaultValue = ' data-default-color=' + defaultValue; // Quotes added automatically.
defaultColorValue = ' data-default-color=' + defaultColorValue; // Quotes added automatically.
}
%>
<div class="elementor-control-field">
<label class="elementor-control-title"><?php echo __( 'Color', 'elementor' ); ?></label>
<label class="elementor-control-title"><?php _e( 'Color', 'elementor' ); ?></label>
<div class="elementor-control-input-wrapper">
<input data-setting="shadow" class="elementor-box-shadow-color-picker" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'elementor' ); ?>" data-alpha="true"<%= defaultValue %> />
<input data-setting="color" class="elementor-box-shadow-color-picker" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'elementor' ); ?>" data-alpha="true"<%= defaultColorValue %> />
</div>
</div>
<?php foreach ( $this->get_sliders() as $slider ) : ?>
Expand Down
2 changes: 1 addition & 1 deletion includes/controls/groups/box-shadow.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function _get_controls( $args ) {
'label' => _x( 'Box Shadow', 'Box Shadow Control', 'elementor' ),
'type' => Controls_Manager::BOX_SHADOW,
'selectors' => [
$args['selector'] => 'box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{SHADOW}};',
$args['selector'] => 'box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}};',
],
'condition' => [
'box_shadow_type!' => '',
Expand Down
20 changes: 10 additions & 10 deletions includes/elements/column.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ protected function _register_controls() {
]
);

$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'box_shadow',
'section' => 'section_style',
'tab' => self::TAB_STYLE,
'selector' => '{{WRAPPER}} > .elementor-element-populated',
]
);

$this->add_group_control(
Group_Control_Background::get_type(),
[
Expand Down Expand Up @@ -71,6 +61,16 @@ protected function _register_controls() {
]
);

$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'box_shadow',
'section' => 'section_style',
'tab' => self::TAB_STYLE,
'selector' => '{{WRAPPER}} > .elementor-element-populated',
]
);

// Section Typography
$this->add_control(
'section_typo',
Expand Down
2 changes: 1 addition & 1 deletion includes/widgets/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected function _after_register_controls() {
Group_Control_Box_Shadow::get_type(),
[
'name' => '_box_shadow',
'section' => '_section_style',
'section' => '_section_background',
'tab' => self::TAB_ADVANCED,
'selector' => '{{WRAPPER}} .elementor-widget-container',
]
Expand Down

0 comments on commit eac034a

Please sign in to comment.