aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/menu_click.min.js
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-16 00:53:10 -0700
committerAllan Wang <me@allanwang.ca>2017-06-16 00:53:10 -0700
commitb9ea80d5b5a06d050ce2c7ca46ed597f4cb499ff (patch)
tree95a8519b719a37dfb791bb6771c940a11e9f7e9e /app/src/main/assets/js/menu_click.min.js
parentf84a05f8aeb73ce63f77b7cc779845c31427b2b2 (diff)
downloadfrost-b9ea80d5b5a06d050ce2c7ca46ed597f4cb499ff.tar.gz
frost-b9ea80d5b5a06d050ce2c7ca46ed597f4cb499ff.tar.bz2
frost-b9ea80d5b5a06d050ce2c7ca46ed597f4cb499ff.zip
Add listener logic
Diffstat (limited to 'app/src/main/assets/js/menu_click.min.js')
-rw-r--r--app/src/main/assets/js/menu_click.min.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/assets/js/menu_click.min.js b/app/src/main/assets/js/menu_click.min.js
index 580f0467..4d508f71 100644
--- a/app/src/main/assets/js/menu_click.min.js
+++ b/app/src/main/assets/js/menu_click.min.js
@@ -1 +1,8 @@
-document.onclick=function(c){c=c||window.event;var b=c.target||c.srcElement;if(b.tagName!=="A"){b=b.parentNode}if(b.tagName==="A"){var a=b.href;console.log("Click Intercept");console.log(a);if(a!=="https://m.facebook.com/settings"&&a!=="https://m.facebook.com/settings#"&&a!=="https://m.facebook.com/settings#!/settings?soft=bookmarks"){Frost.loadUrl(a);Frost.reloadBaseUrl(false)}}}; \ No newline at end of file
+console.log("Registering menu click"),document.addEventListener("click",function(e){
+var t=e.target||e.srcElement
+;if("A"!==t.tagName&&(t=t.parentNode),"A"===t.tagName&&"#"!==t.getAttribute("href")){
+var o=t.href
+;console.log("Click Intercept"),console.log(o),Frost.loadUrl(o),e.stopPropagation(),
+e.preventDefault()
+}
+},!0); \ No newline at end of file