From b93f9ce546e6597975f919ebee4950e620b6bd30 Mon Sep 17 00:00:00 2001 From: = <=> Date: Mon, 5 Sep 2022 09:58:04 -0500 Subject: [PATCH] hide success message in x seconds --- assets/js/checkout.js | 26 +++++++++++++++----------- assets/js/methods.js | 1 + assets/js/script.js | 1 + content/master.blade.php | 2 +- content/pages/checkout.blade.php | 2 +- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/assets/js/checkout.js b/assets/js/checkout.js index 216209e..2bd84cb 100644 --- a/assets/js/checkout.js +++ b/assets/js/checkout.js @@ -59,20 +59,24 @@ function initialize() { } $(window).on('load', google.maps.event, initialize); let input = document.querySelector("#ctelefon"); -let iti = window.intlTelInput(input, { - initialCountry: "de", - preferredCountries: ["de"], - geoIpLookup: function(callback) { - $.get('https://ipinfo.io', function() {}, "jsonp").always(function(resp) { - let countryCode = (resp && resp.country)?resp.country:"us"; - callback(countryCode); - }); - }, - utilsScript: "{{storage('assets/libs/intl-tel-input/js/utils.min.js')}}", -}); +if(input != undefined){ + let iti = window.intlTelInput(input, { + initialCountry: "de", + preferredCountries: ["de"], + geoIpLookup: function(callback) { + $.get('https://ipinfo.io', function() {}, "jsonp").always(function(resp) { + let countryCode = (resp && resp.country)?resp.country:"us"; + callback(countryCode); + }); + }, + utilsScript: "{{storage('assets/libs/intl-tel-input/js/utils.min.js')}}", + }); +} + // iti.getNumber(); function updateProducts(){} $(window).on('load', function(){ + $("#successful-submitting-form").delay(4000).slideUp(200, function() { $(this).alert('close'); }); $('#anfrage').submit(function(){ objProducts = []; localStorage.setItem("products", JSON.stringify(objProducts)); diff --git a/assets/js/methods.js b/assets/js/methods.js index d22e113..52c2b36 100644 --- a/assets/js/methods.js +++ b/assets/js/methods.js @@ -99,6 +99,7 @@ function updateProductsInLocalStorage(){ $('#list-products-in-bag').parent().parent().parent().parent().parent().find('.modal-footer').show(); $('#total-price').parent().parent().parent().show(); $('#no-products').hide(); + $('#modal-buttons').hide(); if(typeof updateProducts === "function"){ $('#form-section').show(); $('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').show(); diff --git a/assets/js/script.js b/assets/js/script.js index 1ab97d5..84e16ca 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -29,6 +29,7 @@ $(window).on('load', function(){ $('#list-products-in-bag').parent().parent().parent().parent().parent().find('.modal-footer').show(); $('#total-price').parent().parent().parent().show(); $('#no-products').hide(); + $('#modal-buttons').hide(); if(typeof updateProducts === "function"){ $('#form-section').show(); $('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').show(); diff --git a/content/master.blade.php b/content/master.blade.php index e123078..f62d79b 100644 --- a/content/master.blade.php +++ b/content/master.blade.php @@ -138,7 +138,7 @@ -