From d0b13318f2450b2fbddfa4db48f275b9e8b3ac24 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 17 Nov 2017 19:17:37 +0200 Subject: [PATCH] -Form custom event --- frontend/controllers/SiteController.php | 1 + frontend/web/js/modal.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 0d677f9..8ba8c45 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -171,6 +171,7 @@ 'success' => true, 'message' => 'Success message', 'alert' => $alert, + 'type' => $type, ]; } else { Yii::$app->response->setStatusCode(500); diff --git a/frontend/web/js/modal.js b/frontend/web/js/modal.js index c12d3b6..f66a264 100755 --- a/frontend/web/js/modal.js +++ b/frontend/web/js/modal.js @@ -59,6 +59,9 @@ $( data: formData, success: function(data) { f.reset(); + if (data.type == 'appointment') { + dataLayer.push({'event': 'mainFormSub'}); + } // form.replaceWith(data.alert) // $(".modal-dialog").append(data.alert); // setTimeout(function(){location.reload()}, 5000); @@ -66,8 +69,7 @@ $( $(".success_").animate({opacity: 1, top: '40'}, 200).addClass("done_"); setTimeout(function(){$(".success_").animate({opacity: 0, top: '0'}, 200,function(){ $(this).removeClass("done_"); - })}, 4000); - + })}, 4000) }, error: function() { -- libgit2 0.21.4