Set the hash to the last clicked item in the FAQ

This commit is contained in:
yflory 2018-10-29 15:26:31 +01:00
parent ce3fef7e1c
commit 4edb1c2e0d
2 changed files with 6 additions and 1 deletions

View File

@ -22,6 +22,9 @@ define([
} }
$(question).toggleClass('cp-active-faq'); $(question).toggleClass('cp-active-faq');
$(answer).slideDown(); $(answer).slideDown();
var t = $(window).scrollTop();
window.location.hash = hash;
$(window).scrollTop(t);
}); });
questions.push(h('div.cp-faq-questions-items', [ questions.push(h('div.cp-faq-questions-items', [
Pages.setHTML(question, item.q), Pages.setHTML(question, item.q),

View File

@ -54,7 +54,9 @@ $(function () {
} else if (/invite/.test(pathname)) { } else if (/invite/.test(pathname)) {
require([ '/invite/main.js'], function () {}); require([ '/invite/main.js'], function () {});
} else if (/faq/.test(pathname)) { } else if (/faq/.test(pathname)) {
window.location.hash = window.location.hash; var hash = window.location.hash;
window.location.hash = '';
window.location.hash = hash;
} else { } else {
require([ '/customize/main.js', ], function () {}); require([ '/customize/main.js', ], function () {});
} }