aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-03-14 19:29:21 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-03-14 19:29:21 +0000
commit491d21469a34b028c00eed7a0f26ff7f3725dcb0 (patch)
treee8f3ca45c7b16b19ece8536c90a0835ffc89c998
parentac16217427341e63a90caaf9e3c13fe1a2e16b72 (diff)
On mobile, make Report a problem a link that scrolls up to the form.
-rw-r--r--templates/web/fixmystreet/footer.html4
-rw-r--r--web/cobrands/fixmystreet/base.scss2
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js6
3 files changed, 9 insertions, 3 deletions
diff --git a/templates/web/fixmystreet/footer.html b/templates/web/fixmystreet/footer.html
index 18f7c7b4b..c73c9eb2c 100644
--- a/templates/web/fixmystreet/footer.html
+++ b/templates/web/fixmystreet/footer.html
@@ -41,8 +41,8 @@
</ul>
<ul id="main-menu">
- <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/" class="report-a-problem-btn"[% END
- %]>[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
+ <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] class="report-a-problem-btn"
+ >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[%
%]<li><[% IF c.req.uri.path == '/my' %]span[% ELSE %]a href="/my"[% END
%]>[% loc("Your reports") %]</[% c.req.uri.path == '/my' ? 'span' : 'a' %]></li>[%
%]<li><[% IF c.req.uri.path == '/reports' %]span[% ELSE %]a href="/reports"[% END
diff --git a/web/cobrands/fixmystreet/base.scss b/web/cobrands/fixmystreet/base.scss
index 97755d8d5..bda29f2cb 100644
--- a/web/cobrands/fixmystreet/base.scss
+++ b/web/cobrands/fixmystreet/base.scss
@@ -512,7 +512,7 @@ p.label-valid {
font-size: 1.25em;
border-bottom: 0.25em solid #333;
}
- a:hover{
+ a:hover, span.hover {
background: #333;
color:#fff;
text-decoration: none;
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index c2801c880..0db8334fb 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -120,6 +120,11 @@ $(function(){
.text('Place pin on map')
.prepend('<a href="/">home</a>');
}
+ $('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');
+ });
} else {
// Make map full screen on non-mobile sizes.
$html.removeClass('mobile');
@@ -146,6 +151,7 @@ $(function(){
.prependTo('#side')
.text('Click map to report a problem');
}
+ $('span.report-a-problem-btn').css({ cursor:'' }).off('.reportBtn');
}
last_type = type;
});