Каталог файловtilda-zero-forms-1.0.js
3701 3702 var input = document.createElement('input');3703 var inputPreferences = { name: 'form_bottom_checkbox' };3704 t_zeroForms__appendMainSettingToField(input, inputPreferences, 'checkbox', 't-checkbox');3705 input.setAttribute('data-tilda-req', '1');3706 if (formObj.formbottomcb === 'cbx') input.checked = true;3707 label.insertAdjacentElement('beforeend', input);3708 3709 var indicator = t_zeroForms__createIndicator('checkbox', formObj.inputelscolor, {3710 size: formObj.togglesize,3711 borderSize: formObj.togglebordersize,
История файла и сравнение версий
checkboxBorderRadius: formObj.checkboxborderradius,
3714 indicator.style.width = '15px'; 3715 indicator.style.height = '15px'; 3716 indicator.style.marginRight = '5px'; 3717 label.insertAdjacentElement('beforeend', indicator); 3719 var labelText = document.createElement('span'); 3720 labelText.classList.add('t-checkbox__labeltext'); 3721 labelText.innerHTML = formBottomText; 3722 label.insertAdjacentElement('beforeend', labelText); 3724 var selector = t_zeroForms__createSelector(recid, formID, '.t-form__bottom-text .t-checkbox__indicator:after'); 3725 var styles = formObj.inputelscolor ? 'color: ' + formObj.inputelscolor + ';' : ''; 3726 styles += 'left:3px;top:0;height:6px;'; 3727 t_zeroForms__addInlineTag({ 3729 id: 't-zero-form-btn-styles-' + formID, 3730 content: selector + '{' + styles + '}', 3741 * @param {HTMLElement} zeroForm - current form element 3742 * @param {formObj} formObj - object with params 3743 * @param {string} recid - record ID 3744 * @param {string} formID - form ID 3746function t_zeroForms__animateInputs(zeroForm, formObj, recid, formID) { 3747 var mainSelector = t_zeroForms__createSelector(recid, formID, ''); 3749 if (formObj.inputcolor) { 3751 '.t-input-group:not(.t-input-group_da):not(.t-input-group_ph):not(.t-input-group_uw):not(.t-input-group_ri):not(.t-input-group_cb):not(.t-input-group_rg) .t-input', 3752 '.t-datepicker__wrapper', 3755 var styles = selectors.map(selector => `${mainSelector} ${selector}`).join(', '); 3756 styles += `{ color: ${formObj.inputcolor}; }`; 3758 t_zeroForms__addInlineTag({ 3760 id: 't-zero-form-anim-styles-' + recid + '-' + formID, 3766 var topOffset = (Number(formObj.inputheight) - Number(formObj.inputfontsize)) / 2; 3767 var fontWeight = formObj.inputfontweight === 'variation' ? formObj.inputvariationweight : formObj.inputfontweight; 3771 '.t-input:not(.t-inputquantity):not(.t-input-phonemask__wrap):not(.t-input-phonemask):not(.t-input__own-answer)'; 3772 var inputList = Array.prototype.slice.call(document.querySelectorAll(selector)); 3773 inputList.forEach(function (input) { 3774 input.classList.add('t-input_pvis'); 3775 input.addEventListener('blur', function (e) { 3776 if (e.target.getAttribute('data-tilda-mask-init') === '1') { 3777 // setTimeout is need for correctly clear input value, after end of focus 3778 setTimeout(function () { 3780 ? e.target.classList.add('t-input_has-content') 3781 : e.target.classList.remove('t-input_has-content'); 3785 ? e.target.classList.add('t-input_has-content') 3786 : e.target.classList.remove('t-input_has-content'); 3790 var placeholder = input.getAttribute('placeholder'); 3791 if (!placeholder) return; 3793 var animField = document.createElement('div'); 3794 animField.classList.add('t-input__vis-ph'); 3795 if (topOffset) animField.style.top = topOffset + 'px'; 3796 if (fontWeight) animField.style.fontWeight = fontWeight; 3797 if (formObj.inputfontsize) { 3798 animField.style.fontSize = formObj.inputfontsize + 'px'; 3799 // increase height for 1 px, to prevent cutting 3800 animField.style.height = parseInt(formObj.inputfontsize, 10) + 1 + 'px';