Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Mar 19, 2021
1 parent 1e022f0 commit 0d522cf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/assets/src/css/components/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
left: 0;
right: 0;
z-index: 1;
width: 100%;
}
}

Expand Down
35 changes: 20 additions & 15 deletions src/views/headers/_header-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,29 @@
*/
\skeeks\assets\unify\base\UnifyIconSimpleLineAsset::register($this);
$this->registerJs(<<<JS
$('body').on('click','.sx-search-btn', function() {
if ($(this).hasClass('sx-search-form-close')){
$('.sx-search-form').animate({top: '-120px'});
$('.sx-search-btn').removeClass('sx-search-form-close');
return false;
}
else {
$('.sx-search-form').animate({top: '100%'});
$('.sx-search-btn').addClass('sx-search-form-close');
return false;
}
});
$('body').on('submit', '.sx-search-form', function() {
alert('111');
sx.block($("body"));
});
$('body').on('click','.sx-search-btn', function() {
if ($(this).hasClass('sx-search-form-close')){
$('.sx-search-form').animate({top: '-120px'});
$('.sx-search-btn').removeClass('sx-search-form-close');
return false;
}
else {
$('.sx-search-form').animate({top: '100%'});
$('.sx-search-form input').focus();
$('.sx-search-btn').addClass('sx-search-form-close');
return false;
}
});
JS
);
?>
<div class="sx-header-menu-item sx-search-btn-block">
<a href="#" class="sx-search-btn sx-icon-wrapper">
<a href="#" class="sx-search-btn sx-icon-wrapper g-text-underline--none--hover">
<i class="icon-magnifier"></i>
</a>
</div>
Expand All @@ -33,7 +38,7 @@
<div class="container">
<div class="row">
<div class="input-group">
<input placeholder="<?= Yii::t("skeeks/unify", "Search"); ?>..." type="text" class="form-control rounded-0"
<input autocomplete="off" placeholder="<?= Yii::t("skeeks/unify", "Search"); ?>..." type="text" class="form-control rounded-0"
name="<?= \Yii::$app->cmsSearch->searchQueryParamName; ?>"
value="<?= \Yii::$app->cmsSearch->searchQuery; ?>">
<div class="input-group-append">
Expand Down
3 changes: 3 additions & 0 deletions src/views/headers/header-mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@
<?php echo $this->render("@app/views/headers/_header-search"); ?>
<? endif; ?>
<?= @$content; ?>
<? if ($this->theme->is_header_auth) : ?>
<?php echo $this->render("@app/views/headers/_header-auth"); ?>
<? endif; ?>
<!-- Responsive Toggle Button -->
<a href="#sx-menu" class="navbar-toggler btn g-px-0 g-valign-middle">
<span class="hamburger">
Expand Down

0 comments on commit 0d522cf

Please sign in to comment.