Commit 71e78660d1bff0fcbe663b90b34241a603af5fe4
1 parent
bca37b08
tokar commit
Showing
5 changed files
with
53 additions
and
20 deletions
Show diff stats
frontend/controllers/SiteController.php
| @@ -89,11 +89,24 @@ class SiteController extends Controller | @@ -89,11 +89,24 @@ class SiteController extends Controller | ||
| 89 | return $out; | 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,7 +38,7 @@ AppAsset::register($this); | ||
| 38 | <a href="/"><img class="logo" src="/images/logo.png" width="100" height="68" alt=""/></a> | 38 | <a href="/"><img class="logo" src="/images/logo.png" width="100" height="68" alt=""/></a> |
| 39 | <div class="header-proektant-slogan">Международная Федерация Проектантов</div> | 39 | <div class="header-proektant-slogan">Международная Федерация Проектантов</div> |
| 40 | <ul class="header-contacts-menu"> | 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 | <li><span><img src="/images/ico-question.png" alt=""/></span><?= Html::a('Помощь',['/site/help'], ['class' =>'contactsLinkModal'])?></li> | 42 | <li><span><img src="/images/ico-question.png" alt=""/></span><?= Html::a('Помощь',['/site/help'], ['class' =>'contactsLinkModal'])?></li> |
| 43 | </ul> | 43 | </ul> |
| 44 | <div class="header-cabinet-wr"> | 44 | <div class="header-cabinet-wr"> |
frontend/views/site/forms-contacts.php deleted
frontend/web/js/forms.js
| @@ -64,29 +64,48 @@ $(document).ready(function(){ | @@ -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 | $('a.contactsLinkModal').click(function(e){ | 90 | $('a.contactsLinkModal').click(function(e){ |
| 68 | e.preventDefault() | 91 | e.preventDefault() |
| 69 | addRemoveBlocks() | 92 | addRemoveBlocks() |
| 70 | addQuestions(); | 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 | \ No newline at end of file | 112 | \ No newline at end of file |