Собрал коллекцию #36
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user