kevin tessier 5 anni fa
parent
commit
b3800e5e04

File diff suppressed because it is too large
+ 0 - 0
user/themes/lecampus/css-compiled/theme.css


File diff suppressed because it is too large
+ 0 - 0
user/themes/lecampus/css-compiled/theme.min.css


+ 27 - 0
user/themes/lecampus/js/site.js

@@ -168,11 +168,38 @@ function burger() {
   });
 }
 
+function ajaxformulaire() {
+  $(".ok").on('click', function () {
+    $(this).parent('#send-valide').remove();
+    location.reload();
+  });
+
+  var form = $('#ajax-test-form');
+  form.submit(function(e) {
+      // prevent form submission
+      e.preventDefault();
+
+      // submit the form via Ajax
+      $.ajax({
+          url: form.attr('action'),
+          type: form.attr('method'),
+          dataType: 'html',
+          data: form.serialize(),
+          success: function(result) {
+              // Inject the result in the HTML
+              $('#form-result').html(result);
+          }
+      });
+  });
+
+}
 
 jQuery(document).ready(function(){
+  // ajaxformulaire();
   addclass();
   mapsalles();
   clickbutton();
+  clicksenddevis();
   links();
   slide();
   filteritem();

+ 4 - 0
user/themes/lecampus/scss/theme/_blog.scss

@@ -977,3 +977,7 @@
     margin-bottom: 10px;
   }
 }
+
+.ok{
+  cursor: pointer;
+}

+ 22 - 24
user/themes/lecampus/templates/form.html.twig

@@ -1,6 +1,28 @@
 {% extends 'partials/base.html.twig' %}
 
 {% block content %}
+<script>
+  $(document).ready(function(){
+
+      var form = $('#ajax-test-form');
+      form.submit(function(e) {
+          // prevent form submission
+          e.preventDefault();
+
+          // submit the form via Ajax
+          $.ajax({
+              url: form.attr('action'),
+              type: form.attr('method'),
+              dataType: 'html',
+              data: form.serialize(),
+              success: function(result) {
+                  // Inject the result in the HTML
+                  $('#form-result').html(result);
+              }
+          });
+      });
+  });
+</script>
 
   <div class="header-wrapper">
     {% if header.entete.text == true %}
@@ -15,28 +37,4 @@
     {% include "forms/form.html.twig" %}
 <div id="form-result"></div>
 
-<script>
-$(document).ready(function(){
-
-    var form = $('#ajax-test-form');
-    form.submit(function(e) {
-        // prevent form submission
-        e.preventDefault();
-
-        // submit the form via Ajax
-        $.ajax({
-            url: form.attr('action'),
-            type: form.attr('method'),
-            dataType: 'html',
-            data: form.serialize(),
-            success: function(result) {
-                // Inject the result in the HTML
-                $('#form-result').html(result);
-            }
-        });
-    });
-});
-</script>
-
-
 {% endblock %}

+ 1 - 1
user/themes/lecampus/templates/partials/base.html.twig

@@ -24,7 +24,7 @@
       {% endblock %}
 
       {% block javascripts %}
-
+          {% do assets.addJs('jquery', 101) %}
           {% do assets.addJs('theme://js/jquery-3.4.1.min.js', {group:'bottom'}) %}
           {% do assets.addJs('theme://js/leaflet.js', {group:'bottom'}) %}
           {% do assets.addJs('theme://js/imagesloaded.pkgd.min.js', {group:'bottom'}) %}

+ 8 - 6
user/themes/lecampus/templates/partials/form-messages.html.twig

@@ -2,14 +2,16 @@
   {% set inline_errors = form.inline_errors is not null ? form.inline_errors : config.plugins.form.inline_errors(false) %}
   {% set status_mapping = {'success':'green', 'error': 'red', 'warning': 'yellow'} %}
   {% set message = inline_errors and form.messages ? "FORM.VALIDATION_FAIL"|t : form.message %}
+
   <script type="text/javascript">
-    var $ok = $('.ok');
-    var $send = $('#send-valide');
 
-    $ok.on('click', function () {
-      $(this).parent('#send-valide').remove();
-      location.reload();
-    })
+    $(document).ready(function(){
+
+      $(".ok").on('click', function () {
+        $(this).parent('#send-valide').remove();
+        location.reload();
+      });
+    });
 
   </script>
 

Some files were not shown because too many files changed in this diff