From 8d4ace1dbea3b38e08a2fa369cf988eaac5b3dba Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 2 Dec 2019 17:37:35 +0100 Subject: fixing more stuff --- StoneIsland/www/js/lib/auth/SignupView.js | 20 ++++++++++++++++++-- StoneIsland/www/js/lib/blogs/StoryView.js | 4 ++-- StoneIsland/www/js/lib/nav/NavView.js | 8 ++++++-- StoneIsland/www/js/lib/view/Serializable.js | 2 ++ 4 files changed, 28 insertions(+), 6 deletions(-) (limited to 'StoneIsland/www/js/lib') diff --git a/StoneIsland/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js index b16ff887..18fecebb 100755 --- a/StoneIsland/www/js/lib/auth/SignupView.js +++ b/StoneIsland/www/js/lib/auth/SignupView.js @@ -63,8 +63,18 @@ var SignupView = FormView.extend({ if (! data.Email.match("@")) { errors.push([ "Email", "Email address is not valid." ]) } if (data.Email.toLowerCase() !== data.ConfirmEmail.toLowerCase()) { errors.push([ "ConfirmEmail", "Email addresses don't match." ]) } // if (data.Gender === "NONE") { errors.push([ "Gender", "Please supply your gender." ]) } - if (data.DataProfiling !== "true") { errors.push([ "DataProfiling", "You must consent to data profiling to use the Stone Island app." ]) } - if (data.GdprTerms !== "true") { errors.push([ "GdprTerms", "You must agree to the Your My Account terms to use the Stone Island app." ]) } + if (data.DataProfiling !== "true") { + errors.push([ "DataProfiling", "You must consent to data profiling to use the Stone Island app." ]) + setTimeout(function(){ + this.$("#checkbox-shopping-data-profiling-label").closest(".checkbox-row").addClass("error_hilite") + }.bind(this), 10) + } + if (data.GdprTerms !== "true") { + errors.push([ "GdprTerms", "You must agree to the Your My Account terms to use the Stone Island app." ]) + setTimeout(function(){ + this.$("#checkbox-shopping-account-terms").closest(".checkbox-row").addClass("error_hilite") + }.bind(this), 10) + } var now = new Date () var year = now.getFullYear() @@ -78,6 +88,12 @@ var SignupView = FormView.extend({ } data.YooxLetter = this.$("[name=YooxLetter]").prop("checked") + if (!data.YooxLetter) { + errors.push([ "YooxLetter", "You must consent to marketing to use the Stone Island app." ]) + setTimeout(function(){ + this.$("#checkbox-data-profiling").closest(".checkbox-row").addClass("error_hilite") + }.bind(this), 10) + } }, finalize: function(data){ diff --git a/StoneIsland/www/js/lib/blogs/StoryView.js b/StoneIsland/www/js/lib/blogs/StoryView.js index 71f1cc0c..19d5bac8 100755 --- a/StoneIsland/www/js/lib/blogs/StoryView.js +++ b/StoneIsland/www/js/lib/blogs/StoryView.js @@ -40,8 +40,8 @@ var StoryView = ScrollableView.extend({ .replace(/{{body}}/, row.body.replace(/\n/g, "
")) var li = document.createElement("li") li.dataset.id = row.id - li.innerHTML = "
" + row.title + "
" - li.setAttribute('role', "link") + li.innerHTML = "
" + row.title + "
" + li.setAttribute('role', "menuitem") this.sections[row.id] = row this.$links.append(li) this.$content.append(t) diff --git a/StoneIsland/www/js/lib/nav/NavView.js b/StoneIsland/www/js/lib/nav/NavView.js index a9a1938e..a6a39633 100755 --- a/StoneIsland/www/js/lib/nav/NavView.js +++ b/StoneIsland/www/js/lib/nav/NavView.js @@ -1,3 +1,5 @@ +var klassTimeout; + var NavView = View.extend({ el: "#nav", @@ -52,14 +54,16 @@ var NavView = View.extend({ doneShowingNav = true }, 800) if (klass) { - setTimeout(function(){ + klassTimeout = setTimeout(function(){ this.addClass(klass) }.bind(this), 500) } }, hide: function(){ - if (!doneShowingNav) return + if (!doneShowingNav) { + clearTimeout(klassTimeout) + } $("body").removeClass("nav") app.curtain.hide("dark") }, diff --git a/StoneIsland/www/js/lib/view/Serializable.js b/StoneIsland/www/js/lib/view/Serializable.js index 08802fa9..0d638412 100755 --- a/StoneIsland/www/js/lib/view/Serializable.js +++ b/StoneIsland/www/js/lib/view/Serializable.js @@ -61,6 +61,7 @@ var SerializableView = View.extend({ focus_input: function(e){ $(e.currentTarget).removeClass("error_hilite") + $(e.currentTarget).closest(".checkbox-row").removeClass("error_hilite") }, focus_date: function(e){ @@ -128,6 +129,7 @@ var SerializableView = View.extend({ // this.$msg.html(msgs.join("
")) this.$msg.addClass('alert-notice') if (app.view.scroller) { + app.view.scroller.refresh() app.view.scroller.scrollTo(0, 0) } }, -- cgit v1.2.3-70-g09d2