|
Lines 99-142
$(document).ready(function () {
Link Here
|
| 99 |
} |
99 |
} |
| 100 |
); |
100 |
); |
| 101 |
|
101 |
|
| 102 |
// form-submit js |
|
|
| 103 |
$("body").on("click", ".submit-form-link", function (e) { |
| 104 |
e.preventDefault(); |
| 105 |
let form_data = $(this).data(); |
| 106 |
|
| 107 |
let confirm_msg = form_data.confirmationMsg; |
| 108 |
if (confirm_msg) { |
| 109 |
let confirmation = confirm(confirm_msg); |
| 110 |
if (!confirmation) { |
| 111 |
return false; |
| 112 |
} |
| 113 |
delete form_data.confirmationMsg; |
| 114 |
} |
| 115 |
|
| 116 |
let the_form = $("<form/>"); |
| 117 |
if (form_data.method === "post") { |
| 118 |
form_data.csrf_token = $('meta[name="csrf-token"]').attr("content"); |
| 119 |
} |
| 120 |
the_form.attr("method", form_data.method); |
| 121 |
the_form.attr("action", form_data.action); |
| 122 |
delete form_data.method; |
| 123 |
delete form_data.action; |
| 124 |
$.each(form_data, function (key, value) { |
| 125 |
the_form.append( |
| 126 |
$("<input/>", { |
| 127 |
type: "hidden", |
| 128 |
name: key, |
| 129 |
value: value, |
| 130 |
}) |
| 131 |
); |
| 132 |
}); |
| 133 |
if (form_data.new_tab) { |
| 134 |
the_form.attr("target", "_blank"); |
| 135 |
} |
| 136 |
$("body").append(the_form); |
| 137 |
the_form.submit(); |
| 138 |
}); |
| 139 |
|
| 140 |
$(".close, .close_window").on("click", function (e) { |
102 |
$(".close, .close_window").on("click", function (e) { |
| 141 |
e.preventDefault(); |
103 |
e.preventDefault(); |
| 142 |
window.close(); |
104 |
window.close(); |
| 143 |
- |
|
|