aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/menu_click.js
blob: 82041b0eef0af664ac7151b6f8d7b3a7c682ff76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// we will handle click events
console.log('Registering menu click');
document.addEventListener('click', function(e) {
  var element = e.target || e.srcElement;
  if (element.tagName !== 'A')
    element = element.parentNode;
  if (element.tagName === 'A' && element.getAttribute('href') !== '#') {
    var url = element.href;
    console.log('Click Intercept');
    console.log(url);
    Frost.loadUrl(url);
    e.stopPropagation();
    e.preventDefault();
  }
}, true);