@alexsab-ru/scripts 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/form.js +3 -3
- package/package.json +1 -1
package/lib/form.js
CHANGED
|
@@ -120,7 +120,7 @@ const showMessageModal = (messageModal, icon, message) => {
|
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
|
|
123
|
-
export const connectForms = (url, callback, callback_error) => {
|
|
123
|
+
export const connectForms = (url, callback, callback_error, ct_routeKey = 'ct_callback', verbose = false) => {
|
|
124
124
|
|
|
125
125
|
// Отправка всех форм
|
|
126
126
|
document.querySelectorAll("form").forEach((form) => {
|
|
@@ -154,7 +154,7 @@ document.querySelectorAll("form").forEach((form) => {
|
|
|
154
154
|
reachGoal("form_submit");
|
|
155
155
|
|
|
156
156
|
// Отправка заявки на обратный возов в CallTouch
|
|
157
|
-
createRequest(
|
|
157
|
+
createRequest(ct_routeKey, phone.value, verbose);
|
|
158
158
|
|
|
159
159
|
let formData = new FormData(form);
|
|
160
160
|
if(getCookie('fta')) {
|
|
@@ -203,7 +203,7 @@ document.querySelectorAll("form").forEach((form) => {
|
|
|
203
203
|
})
|
|
204
204
|
.then((res) => res.json())
|
|
205
205
|
.then((data) => {
|
|
206
|
-
|
|
206
|
+
verbose && console.log(data);
|
|
207
207
|
stateBtn(btn, "Отправить");
|
|
208
208
|
if (data.answer == "required") {
|
|
209
209
|
reachGoal("form_required");
|