From bc2c1a08624cb6c1077dc6dc4f17b1d1468e381e Mon Sep 17 00:00:00 2001 From: captainbeer Date: Wed, 22 Aug 2018 18:40:24 +0300 Subject: [PATCH] -Added some data attributes --- frontend/views/site/index.php | 6 +++--- frontend/web/js/events.js | 32 +++++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/frontend/views/site/index.php b/frontend/views/site/index.php index b94db15..bfd1df8 100644 --- a/frontend/views/site/index.php +++ b/frontend/views/site/index.php @@ -92,7 +92,7 @@ $moduleRequest=\Yii::$app->getModule('request_1'); - + @@ -183,7 +183,7 @@ $moduleRequest=\Yii::$app->getModule('request_1');
@@ -266,7 +266,7 @@ $moduleRequest=\Yii::$app->getModule('request_1');
diff --git a/frontend/web/js/events.js b/frontend/web/js/events.js index 6d73305..126588a 100644 --- a/frontend/web/js/events.js +++ b/frontend/web/js/events.js @@ -1,13 +1,27 @@ $(function() { - $(document).on('beforeSubmit', '.section-forms #contact-form', function(e) { - console.log('Form from page'); - }); + var clicked = null; - $(document).on('submit', '#callback #contact-form', function(e) { - console.log('Call me maby'); - }); + $(document) + .on('click', '.modal-link', function() { + clicked = $(this) + .data('event'); + }); + + $(document) + .on('submit', '.section-forms #contact-form', function(e) { + console.log('Form from page'); + }); + + $(document) + .on('submit', '#callback #contact-form', function(e) { + console.log('Call me maby'); + console.log(clicked); + }); + + $(document) + .on('submit', '#buy-form #contact-form', function(e) { + console.log('Hello from buy form'); + console.log(clicked); + }); - $(document).on('submit', '#buy-form #contact-form', function(e) { - console.log('Hello from buy form'); - }); }); \ No newline at end of file -- libgit2 0.21.4