navigation.mjs 1.25 KB
Newer Older
ransome1's avatar
ransome1 committed
1
2
import { userData, translations } from "../render.js";
import { showContent } from "./content.mjs";
3
import { show } from "./form.mjs";
4
import { _paq } from "./matomo.mjs";
ransome1's avatar
ransome1 committed
5

6
const navBtnAddTodo = document.getElementById("navBtnAddTodo");
ransome1's avatar
ransome1 committed
7
8
9
const navBtnHelp = document.getElementById("navBtnHelp");
const navBtnSettings = document.getElementById("navBtnSettings");
const navBtnView = document.getElementById("navBtnView");
10
const btnTheme = document.getElementById("btnTheme");
ransome1's avatar
ransome1 committed
11
12
13
14

navBtnHelp.firstElementChild.setAttribute("title", translations.help);
navBtnSettings.firstElementChild.setAttribute("title", translations.settings);
navBtnView.firstElementChild.setAttribute("title", translations.view);
15
btnTheme.setAttribute("title", translations.toggleDarkMode);
ransome1's avatar
ransome1 committed
16

17
18
19
20
21
navBtnAddTodo.onclick = function () {
  show();
  // trigger matomo event
  if(userData.matomoEvents) matomo._paq.push(["trackEvent", "Menu", "Click on add todo"]);
}
ransome1's avatar
ransome1 committed
22
navBtnHelp.onclick = function () {
23
  showContent("modalHelp");
ransome1's avatar
ransome1 committed
24
25
26
27
  // trigger matomo event
  if(userData.matomoEvents) _paq.push(["trackEvent", "Menu", "Click on Help"]);
}
navBtnSettings.onclick = function () {
28
  showContent("modalSettings");
ransome1's avatar
ransome1 committed
29
30
31
  // trigger matomo event
  if(userData.matomoEvents) _paq.push(["trackEvent", "Menu", "Click on Settings"]);
}