Skip to content

Commit

Permalink
Search widget issues solved
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikshasaman committed Apr 3, 2020
1 parent a309a87 commit 7b5b1ef
Show file tree
Hide file tree
Showing 7 changed files with 348 additions and 145 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module.exports = function( grunt ) {
}

} );

grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
grunt.loadNpmTasks( 'grunt-bumpup' );
Expand Down
2 changes: 1 addition & 1 deletion assets/css/header-footer-elementor.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
.ehf-header #masthead {
z-index: 200;
position: relative;
}
}
2 changes: 1 addition & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
.hfe-icon-navigation-menu-4:before {
content: "\e904";
color: #556068;
}
}
5 changes: 4 additions & 1 deletion inc/widgets-css/frontend.css
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ div.hfe-nav-menu,
transform: translate(-50%, -50%);
top:50%;
left: 50%;
font-size: 0.55em;
font-size: 20px;
}
/*search icon toggle css*/

Expand Down Expand Up @@ -1659,3 +1659,6 @@ input[type="search"]:focus{
.hfe-search-icon-toggle{
display: inline-block;
}
.hfe-search-form__container .hfe-search-submit {
min-width: 3%;
}
84 changes: 70 additions & 14 deletions inc/widgets-manager/widgets/class-search-button.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ protected function register_general_content_controls() {
]
);



$this->end_controls_section();
}
/**
Expand Down Expand Up @@ -293,13 +295,64 @@ protected function register_search_style_controls() {
'selector' => '{{WRAPPER}} .hfe-search-form__container,{{WRAPPER}} input.hfe-search-form__input',
]
);
$this->add_control(
'border_style',
[
'label' => __( 'Border Style', 'header-footer-elementor' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'label_block' => false,
'options' => [
'none' => __( 'None', 'header-footer-elementor' ),
'solid' => __( 'Solid', 'header-footer-elementor' ),
'double' => __( 'Double', 'header-footer-elementor' ),
'dotted' => __( 'Dotted', 'header-footer-elementor' ),
'dashed' => __( 'Dashed', 'header-footer-elementor' ),
],
'selectors' => [
'{{WRAPPER}} .hfe-search-form__container ,{{WRAPPER}} .hfe-search-icon-toggle .hfe-search-form__input' => 'border-style: {{VALUE}};',
],
]
);

$this->add_group_control(
Group_Control_Border::get_type(),
$this->add_control(
'border_color',
[
'label' => __( 'Border Color', 'header-footer-elementor' ),
'type' => Controls_Manager::COLOR,
'scheme' => [
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_1,
],
'condition' => [
'border_style!' => 'none',
],
'default' => '',
'selectors' => [
'{{WRAPPER}} .hfe-search-form__container, {{WRAPPER}} .hfe-search-icon-toggle .hfe-search-form__input' => 'border-color: {{VALUE}};',
],
]
);

$this->add_control(
'border_width',
[
'name' => 'input_border_color',
'default' => '',
'selector' => '{{WRAPPER}} .hfe-search-form__container, {{WRAPPER}}.hfe-search-layout-icon .hfe-search-button-wrapper input[type=search]',
'label' => __( 'Border Width', 'header-footer-elementor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px' ],
'default' => [
'top' => '1',
'bottom' => '1',
'left' => '1',
'right' => '1',
'unit' => 'px',
],
'condition' => [
'border_style!' => 'none',
],
'selectors' => [
'{{WRAPPER}} .hfe-search-form__container, {{WRAPPER}} .hfe-search-icon-toggle .hfe-search-form__input' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);

Expand All @@ -319,8 +372,7 @@ protected function register_search_style_controls() {
'unit' => 'px',
],
'selectors' => [
'{{WRAPPER}} .hfe-search-form__container,
{{WRAPPER}}.hfe-search-layout-icon .hfe-search-form__input' => 'border-radius: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} .hfe-search-form__container, {{WRAPPER}} .hfe-search-icon-toggle .hfe-search-form__input' => 'border-radius: {{SIZE}}{{UNIT}}',
],
'separator' => 'before',
]
Expand Down Expand Up @@ -505,7 +557,7 @@ protected function register_search_style_controls() {
'{{WRAPPER}} .hfe-search-submit' => 'font-size: {{SIZE}}{{UNIT}}',
],
'default' => [
'size' => '25',
'size' => '21',
'unit' => 'px'
],
'condition' => [
Expand All @@ -522,13 +574,17 @@ protected function register_search_style_controls() {
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 1000,
'step' => 10,
// 'min' => 3,
'max' => 500,
'step' => 5,
],
],
// 'default' => [
// 'min' => '3',
// 'unit' => '%',
// ],
'selectors' => [
'{{WRAPPER}} .hfe-search-submit' => 'width: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} .hfe-search-form__container .hfe-search-submit' => 'width: {{SIZE}}{{UNIT}}',
],
'condition' => [
'layout' => 'icon_text',
Expand Down Expand Up @@ -665,7 +721,7 @@ protected function render() {
<form class="hfe-search-button-wrapper" role="search" action="<?php echo home_url(); ?>" method="get">
<?php if ( 'icon' === $settings['layout'] ) { ?>
<div class = "hfe-search-icon-toggle">
<i aria-hidden="true" class="fas fa-search"></i>
<i class="fas fa-search" aria-hidden="true"></i>
<input <?php echo $this->get_render_attribute_string( 'input' ); ?>>
</div>
<?php } else { ?>
Expand All @@ -675,7 +731,7 @@ protected function render() {
<?php } else { ?>
<input <?php echo $this->get_render_attribute_string( 'input' ); ?>>
<button class="hfe-search-submit" type="submit">
<i aria-hidden="true" class="fas fa-search"></i>
<i class="fas fa-search" aria-hidden="true"></i>
</button>
<?php } ?>
</div>
Expand Down
Loading

0 comments on commit 7b5b1ef

Please sign in to comment.