Commit e5f4f91f authored by Vladimir Zhukov's avatar Vladimir Zhukov
Browse files

save tab scrolls

parent dabe1acb
Pipeline #1490 passed with stage
in 2 seconds
......@@ -6,6 +6,14 @@ const EXP_CHAR_MAPPING = {
4: "T"
};
var TAB_ACTIVE = "#nav-tasks";
var TAB_SCROLLS = {
"#nav-tasks": 0,
"#nav-science": 0,
"#nav-university": 0,
"#nav-grants": 0
};
function bigExpMapping(exp) {
if (exp < 5) {
return EXP_CHAR_MAPPING[exp];
......@@ -304,5 +312,13 @@ $(function () {
showLeaderboard();
});
$(".nav-link").click(function (event) {
TAB_SCROLLS[TAB_ACTIVE] = $("#nav-tabContent").scrollTop();
TAB_ACTIVE = $(this).data("bs-target");
setTimeout(function () {
$("#nav-tabContent").scrollTop(TAB_SCROLLS[TAB_ACTIVE]);
}, 160);
});
setTimeout(update, 1000);
});
......@@ -87,5 +87,5 @@
{% include 'modals/leaderboard.html' %}
{% endblock %}
{% block scripts %}
<script src="{% static 'script.js' %}?v=5"></script>
<script src="{% static 'script.js' %}?v=6"></script>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment