Navigation Menu

Skip to content

Commit

Permalink
IE7 Use JS pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ly authored and rusllonrails committed Apr 23, 2015
1 parent 1379722 commit f0ad9e5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 36 deletions.
46 changes: 22 additions & 24 deletions app/assets/javascripts/application.js.coffee
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions app/assets/stylesheets/frontend/forms.scss
Expand Up @@ -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 {
Expand Down

0 comments on commit f0ad9e5

Please sign in to comment.