|
Lines 267-272
$(document).ready(function () {
Link Here
|
| 267 |
|
267 |
|
| 268 |
observer.observe(document.querySelector(".sticky")); |
268 |
observer.observe(document.querySelector(".sticky")); |
| 269 |
} |
269 |
} |
|
|
270 |
|
| 271 |
// form-submit js |
| 272 |
$("body").on("click", ".submit-form-link", function (e) { |
| 273 |
e.preventDefault(); |
| 274 |
let form_data = $(this).data(); |
| 275 |
|
| 276 |
let confirm_msg = form_data.confirmationMsg; |
| 277 |
if (confirm_msg) { |
| 278 |
let confirmation = confirm(confirm_msg); |
| 279 |
if (!confirmation) { |
| 280 |
return false; |
| 281 |
} |
| 282 |
delete form_data.confirmationMsg; |
| 283 |
} |
| 284 |
|
| 285 |
let the_form = $("<form/>"); |
| 286 |
if (form_data.method === "post") { |
| 287 |
form_data.csrf_token = $('meta[name="csrf-token"]').attr("content"); |
| 288 |
} |
| 289 |
the_form.attr("method", form_data.method); |
| 290 |
the_form.attr("action", form_data.action); |
| 291 |
delete form_data.method; |
| 292 |
delete form_data.action; |
| 293 |
$.each(form_data, function (key, value) { |
| 294 |
the_form.append( |
| 295 |
$("<input/>", { |
| 296 |
type: "hidden", |
| 297 |
name: key, |
| 298 |
value: value, |
| 299 |
}) |
| 300 |
); |
| 301 |
}); |
| 302 |
if (form_data.new_tab) { |
| 303 |
the_form.attr("target", "_blank"); |
| 304 |
} |
| 305 |
$("body").append(the_form); |
| 306 |
the_form.submit(); |
| 307 |
}); |
| 308 |
|
| 270 |
$("html").removeClass("no-js").addClass("js"); |
309 |
$("html").removeClass("no-js").addClass("js"); |
| 271 |
$(".close").click(function () { |
310 |
$(".close").click(function () { |
| 272 |
window.close(); |
311 |
window.close(); |
| 273 |
- |
|
|