aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-04-30 13:57:18 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-05-02 14:28:23 +0100
commit16ccaea6fd30c97f179af18f5e393ef88434f6b4 (patch)
tree2568bfa8510089c6d26234b8dfae7aeb5b88285b /web
parent4204675024cd7d336280c43e3aa986d70bddd06a (diff)
Fix/tidy front-only hover behaviour.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/buckinghamshire/base.scss2
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js13
-rw-r--r--web/cobrands/sass/_base.scss10
-rw-r--r--web/cobrands/sass/_layout.scss8
-rw-r--r--web/js/front.js7
5 files changed, 25 insertions, 15 deletions
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/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 0f63674b9..9059a9c9a 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');
}
};
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index 04562dffb..9a34c4e18 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -551,7 +551,7 @@ ul.error {
a:visited {
color: #333;
}
- a:hover, span.hover {
+ a:hover {
background-color: #333;
color: #fff;
text-decoration: none;
@@ -559,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 {
diff --git a/web/cobrands/sass/_layout.scss b/web/cobrands/sass/_layout.scss
index 1955c6660..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
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);
+ });
+ }
})();