Compare commits

...

2 Commits

Author SHA1 Message Date
ea0321d7f8 Merge pull request 'Собрал коллекцию' (#36) from fix_test into main
Some checks failed
Auto-update README / update-readme (push) Has been cancelled
Reviewed-on: #36
2026-07-14 00:12:41 +03:00
NikDizell
6377e36739 Собрал коллекцию 2026-07-14 00:12:27 +03:00

View File

@ -5,6 +5,17 @@ const CallbackModal = {
floatingBtnId: 'floatingButton',
init() {
const body = document.body;
const showButton = body.dataset.showFloatingButton !== 'false' && body.dataset.showFloatingButton !== '0';
const delay = parseInt(body.dataset.floatingDelay, 10) || 5000;
if (!showButton) {
// Кнопка отключена скрываем навсегда
const btn = document.getElementById(this.floatingBtnId);
if (btn) btn.style.display = 'none';
return;
}
setTimeout(() => {
const btn = document.getElementById(this.floatingBtnId);
if (btn) {
@ -13,7 +24,7 @@ const CallbackModal = {
const button = btn.querySelector('.btn');
if (button) button.classList.add('pulse');
}
}, 5000);
}, delay);
},
open(productTitle) {
@ -21,9 +32,9 @@ const CallbackModal = {
if (modal) {
if (productTitle) {
const questionField = modal.querySelector('#id_question');
if (questionField) {
questionField.value = `Запрос цены по ПП "${productTitle}"`;
const questionField = modal.querySelector('#id_question');
if (questionField) {
questionField.value = `Запрос цены по ПП "${productTitle}"`;
}
}