jekyll-agency 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ $(function() {
10
10
  submitSuccess: function($form, event) {
11
11
  event.preventDefault(); // prevent default submit behaviour
12
12
  // get values from FORM
13
- var url = "https://formspree.io/" + "{{ site.email }}";
13
+ var url = "https://formspree.io/" + "{% if site.formspree_form_path %}{{ site.formspree_form_path }}{% else %}{{ site.email }}{% endif %}";
14
14
  var name = $("input#name").val();
15
15
  var email = $("input#email").val();
16
16
  var phone = $("input#phone").val();
@@ -25,6 +25,7 @@ $(function() {
25
25
  $.ajax({
26
26
  url: url,
27
27
  type: "POST",
28
+ dataType: "json",
28
29
  data: {
29
30
  name: name,
30
31
  phone: phone,
@@ -32,7 +33,7 @@ $(function() {
32
33
  message: message
33
34
  },
34
35
  cache: false,
35
-
36
+
36
37
  success: function() {
37
38
  // Success message
38
39
  $('#success').html("<div class='alert alert-success'>");
@@ -45,7 +46,7 @@ $(function() {
45
46
  //clear all fields
46
47
  $('#contactForm').trigger("reset");
47
48
  },
48
-
49
+
49
50
  error: function() {
50
51
  // Fail message
51
52
  $('#success').html("<div class='alert alert-danger'>");
@@ -56,7 +57,7 @@ $(function() {
56
57
  //clear all fields
57
58
  $('#contactForm').trigger("reset");
58
59
  },
59
-
60
+
60
61
  complete: function() {
61
62
  setTimeout(function() {
62
63
  $this.prop("disabled", false); // Re-enable submit button when AJAX call is complete