diff options
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js')
| -rw-r--r-- | StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js b/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js deleted file mode 100644 index c9235498..00000000 --- a/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js +++ /dev/null @@ -1,90 +0,0 @@ -var ConsentModal = View.extend({ - - el: "#consent_modal", - - events: { - "change [name=AccountTermsConsent]": "changeConsent", - "click #consent_proceed": "proceed", - "click #consent_logout": "logout", - "click a": "navigate", - }, - - initialize: function(){ - 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') - console.log('account_terms.consent', status) - if (status !== 'true') { - console.log('we demand consent!') - app.demand_consent = true - this.show() - return true - } else { - console.log('already received consent!') - this.hide() - app.demand_consent = false - return false - } - }, - - show: function(){ - app.demand_consent = true - this.$el.show() - setTimeout(function(){ - this.$el.addClass('visible') - }.bind(this), 20) - app.curtain.show('opaque') - setTimeout(function(){ - app.curtain.show('opaque') - }, 300) - }, - - hide: function(){ - app.curtain.hide() - this.$el.removeClass('visible') - setTimeout(function(){ - this.$el.hide() - app.curtain.$el.removeClass('opaque') - }.bind(this), 300) - }, - - navigate: function(e){ - var href = $(e.currentTarget).attr('href').replace('#', '') - console.log(href) - this.hide() - app.router.go(href) - }, - - changeConsent: function(){ - var state = this.$checkbox.prop("checked") - 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 - this.hide() - localStorage.setItem('account_terms.consent', 'true') - }, - - logout: function(){ - app.demand_consent = false - this.hide() - localStorage.setItem('account_terms.consent', 'false') - app.router.go("account/logout") - }, - -})
\ No newline at end of file |
