Commit 9c54f5a0e561c87789b813444c56201c2e47d3d9

Authored by Alexey Boroda
2 parents 8e513d6c cd1e4e62

Merge branch 'master' of gitlab.artweb.com.ua:Alexey/kristal-estet

frontend/controllers/SiteController.php
@@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
171 'success' => true, 171 'success' => true,
172 'message' => 'Success message', 172 'message' => 'Success message',
173 'alert' => $alert, 173 'alert' => $alert,
  174 + 'type' => $type,
174 ]; 175 ];
175 } else { 176 } else {
176 Yii::$app->response->setStatusCode(500); 177 Yii::$app->response->setStatusCode(500);
frontend/web/js/modal.js
@@ -59,6 +59,10 @@ $( @@ -59,6 +59,10 @@ $(
59 data: formData, 59 data: formData,
60 success: function(data) { 60 success: function(data) {
61 f.reset(); 61 f.reset();
  62 + if (data.type == 'appointment') {
  63 + console.log('appointment submitted');
  64 + dataLayer.push({'event': 'mainFormSub'});
  65 + }
62 // form.replaceWith(data.alert) 66 // form.replaceWith(data.alert)
63 // $(".modal-dialog").append(data.alert); 67 // $(".modal-dialog").append(data.alert);
64 // setTimeout(function(){location.reload()}, 5000); 68 // setTimeout(function(){location.reload()}, 5000);
@@ -66,8 +70,7 @@ $( @@ -66,8 +70,7 @@ $(
66 $(".success_").animate({opacity: 1, top: '40'}, 200).addClass("done_"); 70 $(".success_").animate({opacity: 1, top: '40'}, 200).addClass("done_");
67 setTimeout(function(){$(".success_").animate({opacity: 0, top: '0'}, 200,function(){ 71 setTimeout(function(){$(".success_").animate({opacity: 0, top: '0'}, 200,function(){
68 $(this).removeClass("done_"); 72 $(this).removeClass("done_");
69 - })}, 4000);  
70 - 73 + })}, 4000)
71 }, 74 },
72 error: function() { 75 error: function() {
73 76