diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-03 11:08:05 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-03 11:08:05 +0100 |
commit | 1a84ff9e9c0675f9487da08e7f5d11088a5d79f8 (patch) | |
tree | 93940979281a13e2e05c41a7a27ae55791bfec49 /web | |
parent | 85cdf1d51ad06836f824a1053924185b7bc8f236 (diff) | |
parent | 536fdcd39d0d6bd76954d6baa672a3b7f266d155 (diff) |
Merge branch 'drop-ie7'
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/angus/layout.scss | 10 | ||||
-rw-r--r-- | web/cobrands/bromley/base.scss | 8 | ||||
-rw-r--r-- | web/cobrands/bromley/layout.scss | 49 | ||||
-rw-r--r-- | web/cobrands/buckinghamshire/base.scss | 2 | ||||
-rw-r--r-- | web/cobrands/fixamingata/layout.scss | 16 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 16 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/header.js | 4 | ||||
-rw-r--r-- | web/cobrands/hart/hart.scss | 6 | ||||
-rw-r--r-- | web/cobrands/sass/_base.scss | 50 | ||||
-rw-r--r-- | web/cobrands/sass/_layout.scss | 75 | ||||
-rw-r--r-- | web/cobrands/stevenage/_council_header_responsive.scss | 7 | ||||
-rw-r--r-- | web/cobrands/stevenage/layout.scss | 44 | ||||
-rw-r--r-- | web/js/front.js | 7 | ||||
-rw-r--r-- | web/js/geolocation.js | 2 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 16 |
15 files changed, 39 insertions, 273 deletions
diff --git a/web/cobrands/angus/layout.scss b/web/cobrands/angus/layout.scss index 9429913b4..988f72df9 100644 --- a/web/cobrands/angus/layout.scss +++ b/web/cobrands/angus/layout.scss @@ -210,16 +210,6 @@ footer p.social a:active,footer p.social a:focus,footer p.social a:hover text-decoration:none; } -// No :before support in IE7, reset things back -.ie7 { - footer p.social a { - font-size:1.2em!important; - height:1.5em; - text-indent:0; - width:auto; - } -} - .angus_nav { display: block; border-bottom: 1px solid $angus_grey_link; diff --git a/web/cobrands/bromley/base.scss b/web/cobrands/bromley/base.scss index 768a3ec67..720dc1099 100644 --- a/web/cobrands/bromley/base.scss +++ b/web/cobrands/bromley/base.scss @@ -323,14 +323,6 @@ input.field, input.text, border-bottom: none!important; } -// Fix the A-Z menu in IE7 -.ie7 { - .main-a-z ul li { - display:block; - float:left; - } -} - // Bromley's breadcrumb .breadcrumb { width: 100%; diff --git a/web/cobrands/bromley/layout.scss b/web/cobrands/bromley/layout.scss index d308daa4b..b54af6df2 100644 --- a/web/cobrands/bromley/layout.scss +++ b/web/cobrands/bromley/layout.scss @@ -19,17 +19,6 @@ body.mappage { } } -// We have to specify this again for IE, since FMS overrides it -.iel8 { - body.fullwidthpage, - body.twothirdswidthpage { - #site-logo { - width: 159px; - height: 114px; - } - } -} - #main-nav { display: block; // remove flex so nav touches top of parent min-height: 0; // no vertical align, so no need for a height @@ -146,21 +135,16 @@ body.fullwidthpage .container .content footer .tablewrapper { .additional-links { float: left; width: 24%; - margin-left: 2%; - margin-right: 2%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; - &:first-child, - &:last-child { - margin-left: 0%; - margin-right: 0%; - } li { padding: 0 1em; } } .footer-list2 { + margin-left: 2%; + margin-right: 2%; width: 48%; ul { overflow: auto; @@ -177,32 +161,3 @@ body.fullwidthpage .container .content footer .tablewrapper { } } } - -// Fix the footer in Old IE because it doesn't like last-child selectors -.iel8 { - .site-footer { - .column { - // Old IE won't float the social media links unless we force the width to be - // smaller and take a more traditional display/float tack. - .social ul li { - display: block; - width: 36px; - float: left; - } - .additional-links { - margin-left: 0%; - margin-right: 0%; - } - .footer-list2 { - margin-left: 2%; - margin-right: 2%; - } - .footer-list2 ul li, - .footer-list1 ul li { - // Old IE needs to know to float these for some reason - float: left; - } - } - } -} - diff --git a/web/cobrands/buckinghamshire/base.scss b/web/cobrands/buckinghamshire/base.scss index 2baf738bc..50cc1a03c 100644 --- a/web/cobrands/buckinghamshire/base.scss +++ b/web/cobrands/buckinghamshire/base.scss @@ -36,7 +36,7 @@ } .nav-menu { - a:hover, span.hover { + a:hover, span.report-a-problem-btn:hover { color: $bucks_green; } } diff --git a/web/cobrands/fixamingata/layout.scss b/web/cobrands/fixamingata/layout.scss index bae9cd89b..e02093b24 100644 --- a/web/cobrands/fixamingata/layout.scss +++ b/web/cobrands/fixamingata/layout.scss @@ -104,13 +104,6 @@ body.mappage { width: auto; } } -.ie7 { - .tablewrapper { - div { - width: auto; - } - } -} #footer-help { ul { @@ -123,15 +116,6 @@ body.mappage { } } } -.ie7 { - #footer-help { - ul { - li { - width: 33%; - } - } - } -} #postcodeForm { margin-left: -1em !important; margin-right: -1em !important; } diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index b40e5ca01..60f15e0b8 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -190,15 +190,6 @@ fixmystreet.resize_to = { $(this).toggleClass('btn--forward btn--cancel'); }); } - - // On the front page, make it so that the "report a problem" menu item - // scrolls to the top of the page, and has a hover effect, rather than - // just being an innert span. - $('span.report-a-problem-btn').on('click.reportBtn', function() { - $('html, body').animate({scrollTop:0}, 500); - }).css({ cursor:'pointer' }).on('hover.reportBtn', function() { - $(this).toggleClass('hover'); - }); }, desktop_page: function() { @@ -209,10 +200,6 @@ fixmystreet.resize_to = { // been put into place by previous mobile UI. $('#report-a-problem-sidebar').show(); $('.rap-notes-trigger').remove(); - - // On a desktop, so reset the "Report a problem" nav item to act - // like an innert span again. - $('span.report-a-problem-btn').css({ cursor:'' }).off('.reportBtn'); } }; @@ -523,7 +510,7 @@ $.extend(fixmystreet.set_up, { on_resize: function() { var last_type; $(window).on('resize', function() { - var type = Modernizr.mq('(min-width: 48em)') || $('html.iel8').length ? 'desktop' : 'mobile'; + var type = Modernizr.mq('(min-width: 48em)') || $('html.ie8').length ? 'desktop' : 'mobile'; if (last_type == type) { return; } if (type == 'mobile') { fixmystreet.resize_to.mobile_page(); @@ -1232,6 +1219,7 @@ $(function() { $(window).on('load', function () { setTimeout(function () { + if (!window.addEventListener) { return; } window.addEventListener('popstate', function(e) { // The user has pressed the Back button, and there is a // stored History state for them to return to. diff --git a/web/cobrands/fixmystreet/header.js b/web/cobrands/fixmystreet/header.js index 103922b08..170073ce3 100644 --- a/web/cobrands/fixmystreet/header.js +++ b/web/cobrands/fixmystreet/header.js @@ -5,8 +5,8 @@ var fixmystreet = fixmystreet || {}; (function(D){ var E = D.documentElement; E.className = E.className.replace(/\bno-js\b/, 'js'); - var iel8 = E.className.indexOf('iel8') > -1; - var type = Modernizr.mq('(min-width: 48em)') || iel8 ? 'desktop' : 'mobile'; + var ie8 = E.className.indexOf('ie8') > -1; + var type = Modernizr.mq('(min-width: 48em)') || ie8 ? 'desktop' : 'mobile'; var meta = D.getElementById('js-meta-data'); if ('IntersectionObserver' in window) { E.className += ' lazyload'; diff --git a/web/cobrands/hart/hart.scss b/web/cobrands/hart/hart.scss index af2b79a50..d8f8599de 100644 --- a/web/cobrands/hart/hart.scss +++ b/web/cobrands/hart/hart.scss @@ -211,12 +211,6 @@ body.frontpage .table-cell .content { } } -// IE specific CSS -.ie7 { - div { zoom: 1; } - input.button { overflow: visible; } -} - // mySociety additions .hart-header { font-size: 12px; diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss index bd5020cfc..4acd7c895 100644 --- a/web/cobrands/sass/_base.scss +++ b/web/cobrands/sass/_base.scss @@ -118,7 +118,7 @@ ol.big-numbers { font: { family: $meta-font; weight:bold; - size:2.5em; + size:2.5rem; } } } @@ -243,10 +243,6 @@ textarea { padding: 0.5em; font-size: 1em; line-height: 1em; - - .ie7 & { - max-width: 95%; - } } textarea { @@ -384,14 +380,6 @@ select.form-control { margin-top: 1.25em; } -// Prevent grey displaying oddly by giving it a width, and stop odd left margin issue -.ie7 .form-box { - width: 100%; - > input[type=text], input[type=email] { - margin-#{$left}: 2em; - } -} - .change_location { color: #666; padding-#{$left}: 20px; @@ -563,7 +551,7 @@ ul.error { a:visited { color: #333; } - a:hover, span.hover { + a:hover { background-color: #333; color: #fff; text-decoration: none; @@ -571,6 +559,14 @@ ul.error { span { background-color: #ccc; } + span.report-a-problem-btn { + cursor: pointer; + } + span.report-a-problem-btn:hover { + background-color: #333; + color: #fff; + text-decoration: none; + } } .shadow-wrap { @@ -653,22 +649,6 @@ ul.error { } } -//because display:table doesn't work we float -.ie7 { - #key-tools { - background: #f5f5f5; - - li { - float: $left; - } - - a { - padding-#{$left}: 1.5em; - padding-#{$right}: 3em; - } - } -} - #report-updates-data img { float: $right; } @@ -1382,16 +1362,8 @@ input.final-submit { #map { width: 100%; height: 100%; - - // IE7 doesn't understand 100% height when the parent height is "auto", - // so we have to explicitly tell it to pin the element to the top and - // bottom of the parent. No need for an ie7-specific condition, because - // this makes no difference in other browsers. - // We keep the "height: 100%" in there to give IE7 context for the 100% - // height on #map's child, div.olMapViewport. + // Needs to be position:absolute for the mobile banners to show on top position: absolute; - top: 0; - bottom: 0; } } diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss index b70e646e3..e996dd123 100644 --- a/web/cobrands/sass/_layout.scss +++ b/web/cobrands/sass/_layout.scss @@ -132,6 +132,14 @@ h1 { span { color:$primary; } + /* Stop mobile-only things */ + span.report-a-problem-btn { + cursor: auto; + } + span.report-a-problem-btn:hover { + background-color: transparent; + color: $primary; + } } // .content Is the white box @@ -322,7 +330,7 @@ body.mappage.admin { // They will no longer stretch the full height of the sidebar, and the // width of #side-report will no longer match the width of .shadow-wrap // when a scrollbar is present. - .iel8 &, + .ie8 &, .ie9 & { @include clearfix(); @@ -420,7 +428,7 @@ body.fullwidthpage { } } -.iel8 { +.ie8 { body.twothirdswidthpage, body.fullwidthpage { .container .content footer a.platform-logo { @@ -509,20 +517,6 @@ body.authpage { } } -//fix table to be a block for ie, float the children -.ie7 { - .tablewrapper { - *zoom: 1; - display:block; - >div { - width:48%; - display:block; - float: $left; - border:none !important; - } - } -} - // adds border to the top and goes full width .bordered { margin:0 -1em; @@ -549,12 +543,6 @@ body.authpage { border-bottom:none; } } -.ie7 { - #footer-mobileapps { - margin:0 0.5em; - margin-#{$right}: 2%; - } -} #footer-help { border-#{$left}: 1em solid transparent; @@ -569,18 +557,6 @@ body.authpage { } } } -.ie7 { - #footer-help { - margin-#{$left}: 2%; - ul { - width:100%; - li { - float: $left; - width: 45%; - } - } - } -} // Openlayers map controls (overrides) #fms_pan_zoom_panup, @@ -787,7 +763,7 @@ body.authpage { padding-top: 0.5em; } } -.iel8 { +.ie8 { .big-green-banner { background-image: url(/cobrands/fixmystreet/images/chevron-white-#{$right}-on-green.gif); } @@ -962,16 +938,6 @@ textarea.form-error { border-right: none; } } -.ie7 #front-main { - #postcodeForm { - div { - input#pc { - height:1.5em; - width:16em; - } - } - } -} #front-howto { border-#{$right}: 1em solid transparent; @@ -994,14 +960,6 @@ textarea.form-error { } } } -.ie7 { - #front_stats { - div { - width:8em; - float: $left; - } - } -} #front-recently { border-#{$left}: 1em solid transparent; @@ -1012,17 +970,6 @@ textarea.form-error { margin-top:0; } -.ie7 { - .tablewrapper { - #front-howto { - margin-#{$right}: 2%; - } - #front-recently { - margin-#{$left}: 2%; - } - } -} - .alerts__columns { @include clearfix; @include flex-container(); diff --git a/web/cobrands/stevenage/_council_header_responsive.scss b/web/cobrands/stevenage/_council_header_responsive.scss index e65f097d9..b0d1a774d 100644 --- a/web/cobrands/stevenage/_council_header_responsive.scss +++ b/web/cobrands/stevenage/_council_header_responsive.scss @@ -53,13 +53,6 @@ float: none; height: auto; - // IE7 doesn't support table-cell - .ie7 & { - display: inline; - float: left; - width: 16.65%; - } - a { width: auto; padding: 6px 12px; diff --git a/web/cobrands/stevenage/layout.scss b/web/cobrands/stevenage/layout.scss index 93ab23268..4d045f00a 100644 --- a/web/cobrands/stevenage/layout.scss +++ b/web/cobrands/stevenage/layout.scss @@ -22,38 +22,14 @@ padding-bottom: 0.25em; background-color: #6b6969; @include linear-gradient(#6b6969, #555454); - - .iel8 & { - background-color: #6b6969; - } } #main-nav { - min-height: 0; + min-height: 1.9em; // Should be 0, but IE8 shrinks background as if floated, then margin-top: 0; float: none; } -// We use absolute positioning for the header on IE7, -// because IE7 doesn't support the table-caption styles. -// This means, we need to make sure page content doesn't -// disappear behind the header. -.ie7 { - .content { - margin-top: 10em; - } - - .frontpage { - #front-main { - margin-top: 15em; - } - - .content { - margin-top: 0; - } - } -} - .nav-menu { float: none; } @@ -156,22 +132,4 @@ body.mappage { a.report-a-problem-btn { color: #fff; } - - // _layout.scss adds 4em of padding to leave space for - // an absolutely positioned menu, but I can't tell what - // that means. Stevenage, at least, doesn't need it. - .wrapper { - .ie7 & { - padding-top: 0; - } - } - - // Not sure why IE7 has the old style of "inset" or "floating" - // sidebar on the map page, but this makes it stop! - .container { - .ie7 & { - margin-left: 0; - } - } - } diff --git a/web/js/front.js b/web/js/front.js index 8471972d4..67486888b 100644 --- a/web/js/front.js +++ b/web/js/front.js @@ -15,4 +15,11 @@ document.getElementById('pc').focus(); var link = around_links[i]; link.href = link.href + (link.href.indexOf('?') > -1 ? '&js=1' : '?js=1'); } + + var lk = document.querySelector('span.report-a-problem-btn'); + if (lk.addEventListener) { + lk.addEventListener('click', function(){ + scrollTo(0,0); + }); + } })(); diff --git a/web/js/geolocation.js b/web/js/geolocation.js index 3c2cf04df..fbef4d7ea 100644 --- a/web/js/geolocation.js +++ b/web/js/geolocation.js @@ -30,7 +30,7 @@ fixmystreet.geolocate = function(element, success_callback) { var link = document.getElementById('geolocate_link'); if (!link) { return; } var https = window.location.protocol.toLowerCase() === 'https:'; - if ('geolocation' in navigator && https) { + if ('geolocation' in navigator && https && window.addEventListener) { fixmystreet.geolocate(link, function(pos) { var latitude = pos.coords.latitude.toFixed(6); var longitude = pos.coords.longitude.toFixed(6); diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 7d0f9076e..a96e65953 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -8,7 +8,7 @@ $.extend(fixmystreet.utils, { if (!location.search) { return qs; } - location.search.substring(1).split(/[;&]/).forEach(function(i) { + $.each(location.search.substring(1).split(/[;&]/), function(n, i) { var s = i.split('='), k = s[0], v = s[1] && decodeURIComponent(s[1].replace(/\+/g, ' ')); @@ -330,20 +330,6 @@ $.extend(fixmystreet.utils, { fixmystreet.markers.refresh({force: true}); } - function parse_query_string() { - var qs = {}; - if (!location.search) { - return qs; - } - location.search.substring(1).split(/[&;]/).forEach(function(i) { - var s = i.split('='), - k = s[0], - v = s[1] && decodeURIComponent(s[1].replace(/\+/g, ' ')); - qs[k] = v; - }); - return qs; - } - function replace_query_parameter(qs, id, key) { var value = $('#' + id).val(); if (value) { |