Fix PWA mobile UX and modal button handlers
- Fixed iOS Safari modal buttons not working (removed inline onclick) - Added 10-second auto-popup for install instructions - Removed floating install buttons on mobile devices - Enhanced mobile experience with modal-only approach - Added proper event listeners for all modal buttons - Improved cross-platform PWA installation flow Mobile UX: Modal-only, Desktop: Button + Modal
This commit is contained in:
27
index.html
27
index.html
@@ -4208,19 +4208,26 @@ window.PWAUtils = {
|
||||
}
|
||||
},
|
||||
|
||||
// Метод для отмены отложенного промпта
|
||||
cancelDelayedPrompt: () => {
|
||||
if (window.pwaInstallPrompt) {
|
||||
return window.pwaInstallPrompt.cancelDelayedPrompt();
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// Метод для перезапуска отложенного промпта
|
||||
rescheduleDelayedPrompt: () => {
|
||||
if (window.pwaInstallPrompt) {
|
||||
window.pwaInstallPrompt.rescheduleDelayedPrompt();
|
||||
if (window.pwaInstallPrompt && window.pwaInstallPrompt.scheduleDelayedPrompt) {
|
||||
// Отменяем существующий таймер и запускаем новый
|
||||
if (window.pwaInstallPrompt.delayedPromptTimeout) {
|
||||
clearTimeout(window.pwaInstallPrompt.delayedPromptTimeout);
|
||||
}
|
||||
window.pwaInstallPrompt.scheduleDelayedPrompt();
|
||||
}
|
||||
},
|
||||
|
||||
// Метод для отмены отложенного промпта
|
||||
cancelDelayedPrompt: () => {
|
||||
if (window.pwaInstallPrompt && window.pwaInstallPrompt.delayedPromptTimeout) {
|
||||
clearTimeout(window.pwaInstallPrompt.delayedPromptTimeout);
|
||||
window.pwaInstallPrompt.delayedPromptTimeout = null;
|
||||
console.log('⏰ Delayed install prompt cancelled via PWAUtils');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user