diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 9d656ef..85953a3 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -89,11 +89,24 @@ class SiteController extends Controller return $out; } - public function actionFormsModal() + public function actionFormsModalContacts() { - return $this->renderAjax('forms-modal', [ - ]); + return $this->renderAjax('forms-modal-contacts', []); + } + + public function actionFormsModalFav() + { + return $this->renderAjax('forms-modal-fav', []); + } + public function actionFormsModalHelp() + { + return $this->renderAjax('forms-modal-help', []); + } + + public function actionFormsModalOffer() + { + return $this->renderAjax('forms-modal-offer', []); } /** diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index 04e139b..34907a8 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -38,7 +38,7 @@ AppAsset::register($this);
Международная Федерация Проектантов
diff --git a/frontend/views/site/forms-contacts.php b/frontend/views/site/forms-contacts.php deleted file mode 100644 index e69de29..0000000 --- a/frontend/views/site/forms-contacts.php +++ /dev/null diff --git a/frontend/views/site/forms-modal-contacts.php b/frontend/views/site/forms-modal-contacts.php new file mode 100644 index 0000000..d56695a --- /dev/null +++ b/frontend/views/site/forms-modal-contacts.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/web/js/forms.js b/frontend/web/js/forms.js index 1c546ab..86901b5 100755 --- a/frontend/web/js/forms.js +++ b/frontend/web/js/forms.js @@ -64,29 +64,48 @@ $(document).ready(function(){ + + + + function addQuestions() { + $.post("site/forms-modal-help", function (data) { + $('.forms-modal-hide').append(data) + }) + .fail(function(){ + addRemoveBlocks() + alert('ВОЗНИКЛА ОШИБКА, ПОПРОБУЙТЕ ЕЩЕ РАЗ ПОЗЖЕ!') + }) + .done(function() { + var newMarg = $(window).scrollTop(); + $('#overlay').fadeIn(400, + function(){ + $('.forms-modal-hide>div') + .css({display:'block', marginTop:-230+newMarg}) + .animate({opacity: 1, top: '50%'}, 200); + }); + }) + } + + $('a.contactsLinkModal').click(function(e){ e.preventDefault() addRemoveBlocks() addQuestions(); }) + clocseModalForms() + function clocseModalForms(){ + $('body').on('click','.closed-form, #overlay', function(){ + $('.forms-modal-hide>div') + .animate({opacity: 0, top: '30%'}, 200, + function(){ + $(this).css('display', 'none') + $('#overlay').fadeOut(400,function(){$('#overlay, .forms-modal-hide').remove()}) + } + ) - function addQuestions() { - - $.post("site/forms-modal-help", function (data) { - $('.forms-modal-hide').append(data); - }) + }); + } - //$('sdsds').click(function(e){ - // var newMarg = $(window).scrollTop(); - // - // $('#overlay').fadeIn(400, - // function(){ - // $('#modal_form_question') - // .css({display:'block', marginTop:-230+newMarg}) - // .animate({opacity: 1, top: '50%'}, 200); - // }); - //}) - } }) \ No newline at end of file -- libgit2 0.21.4