Commit 0edbd4efccbbaa53121ef0db224caea0947a6199

Authored by Виталий
1 parent 114db4fb

tokar commit

frontend/views/layouts/main.php
@@ -125,7 +125,7 @@ AppAsset::register($this); @@ -125,7 +125,7 @@ AppAsset::register($this);
125 <button type="submit" value=""></button> 125 <button type="submit" value=""></button>
126 <div class="search-list"> 126 <div class="search-list">
127 <span>Проекты</span> 127 <span>Проекты</span>
128 - <ul> 128 + <ul class="search-ul">
129 <li>Проекты</li> 129 <li>Проекты</li>
130 <li>Исполнители</li> 130 <li>Исполнители</li>
131 <li>Заказчики</li> 131 <li>Заказчики</li>
frontend/web/css/style.css
@@ -4979,9 +4979,10 @@ input.custom-check:checked + label span, input.custom-check:checked + label:hove @@ -4979,9 +4979,10 @@ input.custom-check:checked + label span, input.custom-check:checked + label:hove
4979 border-bottom: 1px solid #b7b7b7; 4979 border-bottom: 1px solid #b7b7b7;
4980 display: none; 4980 display: none;
4981 } 4981 }
  4982 +.search-list ul.active {display: block}
4982 .search-list li { 4983 .search-list li {
4983 list-style: none; 4984 list-style: none;
4984 - padding: 0 20px 0 10px; 4985 + padding: 0 0 0 10px;
4985 border-top: 1px solid #b7b7b7; 4986 border-top: 1px solid #b7b7b7;
4986 height: 20px; 4987 height: 20px;
4987 line-height: 20px; 4988 line-height: 20px;
@@ -4989,6 +4990,8 @@ input.custom-check:checked + label span, input.custom-check:checked + label:hove @@ -4989,6 +4990,8 @@ input.custom-check:checked + label span, input.custom-check:checked + label:hove
4989 font-size: 13px; 4990 font-size: 13px;
4990 color: #b7b7b7; 4991 color: #b7b7b7;
4991 cursor: pointer; 4992 cursor: pointer;
  4993 + width: 118px;
  4994 + box-sizing: border-box;
4992 } 4995 }
4993 .search-list li:hover { 4996 .search-list li:hover {
4994 transition: 0.2s; 4997 transition: 0.2s;
frontend/web/js/script.js
@@ -826,4 +826,28 @@ $(document).ready(function(){ @@ -826,4 +826,28 @@ $(document).ready(function(){
826 } 826 }
827 827
828 828
  829 +
  830 + $('.search-list span').click(function(){
  831 + if($('.search-ul').hasClass('active')) {
  832 + $('.search-list ul').removeClass('active');
  833 + $('.search-main-menu form input').focus()
  834 + } else {
  835 + $('.search-list ul').addClass('active');
  836 +
  837 + }
  838 + $('.search-list ul.active li').click(function(){
  839 + $('.search-list ul').removeClass('active');
  840 + $('.search-list span').html($(this).text())
  841 + var searchListIndex = $(this).index()
  842 + searchListIndex = searchListIndex+1
  843 + $('.search-main-menu form input[type="hidden"]').val(searchListIndex)
  844 + $('.search-main-menu form input').focus()
  845 + })
  846 +
  847 +
  848 +
  849 + })
  850 +
  851 +
  852 +
829 }); 853 });
830 \ No newline at end of file 854 \ No newline at end of file