Merge pull request 'Собрал коллекцию' (#36) from fix_test into main
Some checks failed
Auto-update README / update-readme (push) Has been cancelled
Some checks failed
Auto-update README / update-readme (push) Has been cancelled
Reviewed-on: #36
This commit is contained in:
commit
ea0321d7f8
@ -5,6 +5,17 @@ const CallbackModal = {
|
|||||||
floatingBtnId: 'floatingButton',
|
floatingBtnId: 'floatingButton',
|
||||||
|
|
||||||
init() {
|
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(() => {
|
setTimeout(() => {
|
||||||
const btn = document.getElementById(this.floatingBtnId);
|
const btn = document.getElementById(this.floatingBtnId);
|
||||||
if (btn) {
|
if (btn) {
|
||||||
@ -13,7 +24,7 @@ const CallbackModal = {
|
|||||||
const button = btn.querySelector('.btn');
|
const button = btn.querySelector('.btn');
|
||||||
if (button) button.classList.add('pulse');
|
if (button) button.classList.add('pulse');
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, delay);
|
||||||
},
|
},
|
||||||
|
|
||||||
open(productTitle) {
|
open(productTitle) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user