aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/js/front.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/web/js/front.js b/web/js/front.js
index db0228597..1efa516fd 100644
--- a/web/js/front.js
+++ b/web/js/front.js
@@ -10,6 +10,7 @@ document.getElementById('pc').focus();
el.value = 1;
form.insertBefore(el, form.firstChild);
}
+
var around_links = document.querySelectorAll('a[href*="around"]');
for (i=0; i<around_links.length; i++) {
var link = around_links[i];
@@ -18,8 +19,19 @@ document.getElementById('pc').focus();
var lk = document.querySelector('span.report-a-problem-btn');
if (lk && lk.addEventListener) {
- lk.addEventListener('click', function(){
+ lk.addEventListener('click', function(e){
+ e.preventDefault();
+ scrollTo(0,0);
+ document.getElementById('pc').focus();
+ });
+ }
+
+ var cta = document.getElementById('report-cta');
+ if (cta && cta.addEventListener) {
+ cta.addEventListener('click', function(e) {
+ e.preventDefault();
scrollTo(0,0);
+ document.getElementById('pc').focus();
});
}
})();