Commit d0b13318f2450b2fbddfa4db48f275b9e8b3ac24
1 parent
484adcb4
-Form custom event
Showing
2 changed files
with
5 additions
and
2 deletions
Show diff stats
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,9 @@ $( | @@ -59,6 +59,9 @@ $( | ||
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 | + dataLayer.push({'event': 'mainFormSub'}); | ||
64 | + } | ||
62 | // form.replaceWith(data.alert) | 65 | // form.replaceWith(data.alert) |
63 | // $(".modal-dialog").append(data.alert); | 66 | // $(".modal-dialog").append(data.alert); |
64 | // setTimeout(function(){location.reload()}, 5000); | 67 | // setTimeout(function(){location.reload()}, 5000); |
@@ -66,8 +69,7 @@ $( | @@ -66,8 +69,7 @@ $( | ||
66 | $(".success_").animate({opacity: 1, top: '40'}, 200).addClass("done_"); | 69 | $(".success_").animate({opacity: 1, top: '40'}, 200).addClass("done_"); |
67 | setTimeout(function(){$(".success_").animate({opacity: 0, top: '0'}, 200,function(){ | 70 | setTimeout(function(){$(".success_").animate({opacity: 0, top: '0'}, 200,function(){ |
68 | $(this).removeClass("done_"); | 71 | $(this).removeClass("done_"); |
69 | - })}, 4000); | ||
70 | - | 72 | + })}, 4000) |
71 | }, | 73 | }, |
72 | error: function() { | 74 | error: function() { |
73 | 75 |