aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/click_a.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/assets/js/click_a.js')
-rw-r--r--app/src/main/assets/js/click_a.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/src/main/assets/js/click_a.js b/app/src/main/assets/js/click_a.js
new file mode 100644
index 00000000..d3eb8631
--- /dev/null
+++ b/app/src/main/assets/js/click_a.js
@@ -0,0 +1,17 @@
+// we will handle click events
+console.log('Registering frost_a click');
+
+var _frostAClick = 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.getAttribute('href');
+ console.log('Click Intercept', url);
+ Frost.loadUrl(url);
+ e.stopPropagation();
+ e.preventDefault();
+ }
+}
+
+document.addEventListener('click', _frostAClick, true);