From f0ad9e592e6a338e6857ca3651cfa49be700bfb4 Mon Sep 17 00:00:00 2001 From: Michael Ly Date: Tue, 21 Apr 2015 18:13:34 +0100 Subject: [PATCH] IE7 Use JS pages --- app/assets/javascripts/application.js.coffee | 46 ++++++++++---------- app/assets/stylesheets/frontend/forms.scss | 12 ----- 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 1d86c1aef..2d69c1d64 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -26,15 +26,14 @@ jQuery -> window.FormValidation.validate() $(document).on "submit", ".qae-form", (e) -> - if !$("html").hasClass("lte-ie7") - $("body").addClass("tried-submitting") - if not validate() - $("body").addClass("show-error-page") - $(".steps-progress-bar .step-current").removeClass("step-current") - $("html, body").animate( - scrollTop: 0 - , 0) - return false + $("body").addClass("tried-submitting") + if not validate() + $("body").addClass("show-error-page") + $(".steps-progress-bar .step-current").removeClass("step-current") + $("html, body").animate( + scrollTop: 0 + , 0) + return false # Hidden hints as seen on # https://www.gov.uk/service-manual/user-centred-design/resources/patterns/help-text @@ -243,21 +242,20 @@ jQuery -> window.location.hash = $(".js-step-condition.step-current").attr("data-step").substr(5) $(document).on "click", ".js-step-link", (e) -> - if !$("html").hasClass("lte-ie7") - e.preventDefault() - if !$(this).hasClass("step-current") - current = $(this).attr("data-step") - if $(this).hasClass "js-next-link" - if $("body").hasClass("tried-submitting") - validate() - autosave() - showAwardStep(current) - # Scroll to top - $("html, body").animate( - scrollTop: 0 - , 0) - # Resize textareas that were previously hidden - resetResizeTextarea() + e.preventDefault() + if !$(this).hasClass("step-current") + current = $(this).attr("data-step") + if $(this).hasClass "js-next-link" + if $("body").hasClass("tried-submitting") + validate() + autosave() + showAwardStep(current) + # Scroll to top + $("html, body").animate( + scrollTop: 0 + , 0) + # Resize textareas that were previously hidden + resetResizeTextarea() autosave = () -> window.autosave_timer = null diff --git a/app/assets/stylesheets/frontend/forms.scss b/app/assets/stylesheets/frontend/forms.scss index 1a47414b5..5a7595b32 100644 --- a/app/assets/stylesheets/frontend/forms.scss +++ b/app/assets/stylesheets/frontend/forms.scss @@ -957,18 +957,6 @@ input[type="file"] { text-decoration: none; } } - - .if-js-hide { - .lte-ie7 & { - display: none !important; - } - } - - .if-no-js-hide { - .lte-ie7 & { - display: block !important; - } - } } li.submit {