Some styles improvement attempts (how to uniformize modals?)
[vchess.git] / public / javascripts / index.js
index 007c9fe..54c296b 100644 (file)
@@ -1,3 +1,4 @@
+// Javascript for index page: mostly counters updating
 new Vue({
        el: "#indexPage",
        data: {
@@ -7,7 +8,11 @@ new Vue({
        },
        computed: {
                sortedCounts: function () {
-                       const variantsCounts = variantArray.map( v => {
+                       const variantsCounts = variantArray
+                       .filter( v => {
+                               return v.name.startsWith(this.curPrefix);
+                       })
+                       .map( v => {
                                return {
                                        name: v.name,
                                        desc: v.description,
@@ -79,5 +84,9 @@ new Vue({
                        document.getElementById("modal-b4welcome").checked = false;
                        document.getElementById("modal-welcome").checked = true;
                },
+               markAsVisited: function() {
+                       setCookie('visited', '1');
+                       document.getElementById('modal-welcome').checked = false;
+               },
        },
 });