Commit 71e78660d1bff0fcbe663b90b34241a603af5fe4

Authored by Виталий
1 parent bca37b08

tokar commit

frontend/controllers/SiteController.php
... ... @@ -89,11 +89,24 @@ class SiteController extends Controller
89 89 return $out;
90 90 }
91 91  
92   - public function actionFormsModal()
  92 + public function actionFormsModalContacts()
93 93 {
94   - return $this->renderAjax('forms-modal', [
95   - ]);
  94 + return $this->renderAjax('forms-modal-contacts', []);
  95 + }
  96 +
  97 + public function actionFormsModalFav()
  98 + {
  99 + return $this->renderAjax('forms-modal-fav', []);
  100 + }
96 101  
  102 + public function actionFormsModalHelp()
  103 + {
  104 + return $this->renderAjax('forms-modal-help', []);
  105 + }
  106 +
  107 + public function actionFormsModalOffer()
  108 + {
  109 + return $this->renderAjax('forms-modal-offer', []);
97 110 }
98 111  
99 112 /**
... ...
frontend/views/layouts/main.php
... ... @@ -38,7 +38,7 @@ AppAsset::register($this);
38 38 <a href="/"><img class="logo" src="/images/logo.png" width="100" height="68" alt=""/></a>
39 39 <div class="header-proektant-slogan">Международная Федерация Проектантов</div>
40 40 <ul class="header-contacts-menu">
41   - <li><span><img src="/images/ico-contact.png" alt=""/></span><a href="#">Контакты</a></li>
  41 + <li><span><img src="/images/ico-contact.png" alt=""/></span><?= Html::a('Контакты','', ['class' =>'contactsLinkModalFirst'])?></li>
42 42 <li><span><img src="/images/ico-question.png" alt=""/></span><?= Html::a('Помощь',['/site/help'], ['class' =>'contactsLinkModal'])?></li>
43 43 </ul>
44 44 <div class="header-cabinet-wr">
... ...
frontend/views/site/forms-contacts.php deleted
frontend/views/site/forms-modal-contacts.php 0 → 100644
  1 +<script>alert('no-contacts')</script>
0 2 \ No newline at end of file
... ...
frontend/web/js/forms.js
... ... @@ -64,29 +64,48 @@ $(document).ready(function(){
64 64  
65 65  
66 66  
  67 +
  68 +
  69 +
  70 + function addQuestions() {
  71 + $.post("site/forms-modal-help", function (data) {
  72 + $('.forms-modal-hide').append(data)
  73 + })
  74 + .fail(function(){
  75 + addRemoveBlocks()
  76 + alert('ВОЗНИКЛА ОШИБКА, ПОПРОБУЙТЕ ЕЩЕ РАЗ ПОЗЖЕ!')
  77 + })
  78 + .done(function() {
  79 + var newMarg = $(window).scrollTop();
  80 + $('#overlay').fadeIn(400,
  81 + function(){
  82 + $('.forms-modal-hide>div')
  83 + .css({display:'block', marginTop:-230+newMarg})
  84 + .animate({opacity: 1, top: '50%'}, 200);
  85 + });
  86 + })
  87 + }
  88 +
  89 +
67 90 $('a.contactsLinkModal').click(function(e){
68 91 e.preventDefault()
69 92 addRemoveBlocks()
70 93 addQuestions();
71 94 })
72 95  
  96 + clocseModalForms()
  97 + function clocseModalForms(){
  98 + $('body').on('click','.closed-form, #overlay', function(){
  99 + $('.forms-modal-hide>div')
  100 + .animate({opacity: 0, top: '30%'}, 200,
  101 + function(){
  102 + $(this).css('display', 'none')
  103 + $('#overlay').fadeOut(400,function(){$('#overlay, .forms-modal-hide').remove()})
  104 + }
  105 + )
73 106  
74   - function addQuestions() {
75   -
76   - $.post("site/forms-modal-help", function (data) {
77   - $('.forms-modal-hide').append(data);
78   - })
  107 + });
  108 + }
79 109  
80 110  
81   - //$('sdsds').click(function(e){
82   - // var newMarg = $(window).scrollTop();
83   - //
84   - // $('#overlay').fadeIn(400,
85   - // function(){
86   - // $('#modal_form_question')
87   - // .css({display:'block', marginTop:-230+newMarg})
88   - // .animate({opacity: 1, top: '50%'}, 200);
89   - // });
90   - //})
91   - }
92 111 })
93 112 \ No newline at end of file
... ...