From 320d1d0cee7e0ebdcc6477eaa76a4d7efb9dbfdb Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 9 Oct 2023 17:48:48 +0200 Subject: [PATCH] wait #6368 @0.5 --- resources/js/app.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/resources/js/app.js b/resources/js/app.js index 739190e..62d92e8 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -127,8 +127,9 @@ const app = new Vue({ this.validateAction = this.$refs.forgotpwd?.dataset.status //specific code for the forgot password confirmation let option = this.$refs.optionsExist?.dataset.val; - this.statusConfig = !option && this.price ? true : false + this.statusConfig = option===undefined ||(!option && this.price); + console.log(this.$refs.optionsExist,option,this.statusConfig,this.price); }, watch: { @@ -206,6 +207,7 @@ const app = new Vue({ console.error('Error saving cart!', error); }); }, + openCart(event) { // Only trigger cart popup on larger screens // On smaller screens, the link will behave as normal. @@ -214,6 +216,7 @@ const app = new Vue({ document.body.classList.add('cart-open'); } }, + closeCart() { document.body.classList.remove('cart-open'); }, @@ -229,12 +232,14 @@ const app = new Vue({ behavior: "smooth" }) }, + lockTab(tab) { // Add hash to url to stay in same tab when page is reloading // It used in account page when we navigate between different tab let fullUrl = window.location.origin + window.location.pathname history.pushState("", "", fullUrl + '#' + tab); }, + activeTab(tab) { this.tab = tab this.lockTab(tab) @@ -242,9 +247,11 @@ const app = new Vue({ this.errorsForm = {} this.removeErrorsForm() }, + toggleType(el) { this.type[el] = this.type[el] === "password" ? "text" : "password" }, + removeErrorsForm() { let errors = document.querySelector('.form-errors'), errorInput = document.querySelectorAll('.error') @@ -256,6 +263,7 @@ const app = new Vue({ this.errorsForm = {} }, + errorHandling(data, root, form) { if (data.response) { let errors = {'errors': data.response.data.errors, 'id': form} @@ -283,6 +291,7 @@ const app = new Vue({ } } }, + animateDelete(el, parent = null) { el.animate([ {opacity: 1}, @@ -296,6 +305,7 @@ const app = new Vue({ parent && !el.classList.contains('ajax-form') ? el.parentElement.remove() : el.remove() }, 1000) }, + checkEmailExist() { let root = this, data = { @@ -315,6 +325,7 @@ const app = new Vue({ } ) }, + signin() { let root = this, form = document.getElementById('signin-form'), @@ -345,6 +356,7 @@ const app = new Vue({ } ) }, + signup() { let root = this, form = document.getElementById('signup-form'), @@ -369,6 +381,7 @@ const app = new Vue({ } ) }, + getUser() { let root = this -- 2.39.5