aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/front.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js/front.js')
-rw-r--r--web/js/front.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/web/js/front.js b/web/js/front.js
index 67486888b..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];
@@ -17,9 +18,20 @@ document.getElementById('pc').focus();
}
var lk = document.querySelector('span.report-a-problem-btn');
- if (lk.addEventListener) {
- lk.addEventListener('click', function(){
+ if (lk && lk.addEventListener) {
+ 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();
});
}
})();