1301break;1302case 'contact_method': // способ связи1303var contactMethods = t_zeroForms__getContactMethods(elementObj);1304generatedField = t_zeroForms__createContactMethod(recid, {1305formID,1306elementObj,1307contactMethods,1308formObj,1309inputStyles,1310inputPreferences,1311});1312if (!generatedField) break;
// Поле считается готовым только после инициализации скрипта, который отправит событие inputReady inputGroup.setAttribute('data-field-async', 'true'); // В редакторе Zero Block нет tilda-scripts (t_loadJsFile), поэтому скрипт маски подключаем сами if (contactMethods.some(method => method.hasPhone)) { t_zeroForms__addResource({ recId: recid, id: 't-zero-phonemask', path: 'tilda-phone-mask-1.1.min.js', type: 'script', }); } t_zeroForms__addResource({ recId: recid, id: 't-zero-contact-method-script', path: 'tilda-contact-method-1.0.min.js', type: 'script', }); // Поле инициализируется во всех режимах, включая редакторы, чтобы маска телефона выглядела как на сайте t_zeroForms__onNextRender(zeroForm, function () { t_zeroForms__onFuncLoad('t_contactMethod__init', function () { t_contactMethod__init(recid, elementObj.lid); }); }); break; case 'rs': // rating scale var rateScaleSettings = t_zeroForms__getRateScaleSettings(elementObj); generatedField = t_zeroForms__createRateScale({ elementObj, formObj, inputPreferences, settings: rateScaleSettings, }); if (rateScaleSettings.type === 'numbers') { t_zeroForms__setRateScaleNumbersStyles(recid, formID, formObj, zeroForm); } // Поле считается готовым только после инициализации скрипта, который отправит событие inputReady inputGroup.setAttribute('data-field-async', 'true'); t_zeroForms__addResource({ recId: recid, id: 't-zero-ratescale-script', path: 'tilda-ratescale-1.0.min.js', type: 'script', }); // Поле инициализируется во всех режимах, чтобы в редакторах работало так же, как на сайте t_zeroForms__onNextRender(zeroForm, function () { t_zeroForms__onFuncLoad('t_rateScale__init', function () { t_rateScale__init(recid, elementObj.lid, rateScaleSettings.type); }); }); break; } if (generatedField) inputBlock.appendChild(generatedField); var errorBox = document.createElement('div'); errorBox.classList.add('t-input-error'); inputBlock.insertAdjacentElement('beforeend', errorBox); inputGroup.insertAdjacentElement('beforeend', inputBlock); if (formObj.inputpos !== 'h') { var liType = elementObj.li_type; if ( liType === 'em' || liType === 'ph' || liType === 'nm' || liType === 'in' || liType === 'ta' || liType === 'sb' || liType === 'cb' || liType === 'uw' || liType === 'da' || liType === 'tm' || liType === 'qn' || liType === 'rg' || liType === 'ur' || liType === 'tx' || liType === 'contact_method' || liType === 'rs' ) { t_zeroForms__setFieldsRowClasses(inputPreferences, inputGroup); } if (elementObj.li_type === 'rd') {