From 189eccc46edd09e78c9683580ccf078c28d5b34e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 15 Aug 2018 13:50:35 +0200 Subject: consent modal stuff --- StoneIsland/www/js/lib/account/ConsentModal.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'StoneIsland/www/js/lib/account/ConsentModal.js') diff --git a/StoneIsland/www/js/lib/account/ConsentModal.js b/StoneIsland/www/js/lib/account/ConsentModal.js index 22f63c53..dfeb4fac 100644 --- a/StoneIsland/www/js/lib/account/ConsentModal.js +++ b/StoneIsland/www/js/lib/account/ConsentModal.js @@ -13,11 +13,13 @@ var ConsentModal = View.extend({ this.$form = this.$(".form") this.$msg = this.$(".msg") this.$checkbox = this.$("[name=AccountTermsConsent]") + this.$consentError = this.$("#consent_error") }, check: function(){ var status = localStorage.getItem('account_terms.consent') if (status !== 'true') { + app.demand_consent = true this.show() return true } else { @@ -55,16 +57,17 @@ var ConsentModal = View.extend({ changeConsent: function(){ var state = this.$checkbox.prop("checked") - // if (state) { - // this.$el.addClass('consent-yes').removeClass('consent-no') - // } else { - // this.$el.addClass('consent-no').removeClass('consent-yes') - // } + if (state) { + this.$consentError.removeClass('visible') + } else { + this.$consentError.addClass('visible') + } }, proceed: function(){ var state = this.$checkbox.prop("checked") if (!state) { + this.$consentError.addClass('visible') return } app.demand_consent = false -- cgit v1.2.3-70-g09d2