aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/click_a.js
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-10-24 23:29:55 -0400
committerGitHub <noreply@github.com>2017-10-24 23:29:55 -0400
commitc2ca9066c6fd760bd6ef5d2f8f0530a89bfa7b66 (patch)
treea54665bb873b650b8f6f03b76cd59456ef79e296 /app/src/main/assets/js/click_a.js
parent64dbf74b7a44a25f41ed7ff2ebfa11db0bc91769 (diff)
downloadfrost-c2ca9066c6fd760bd6ef5d2f8f0530a89bfa7b66.tar.gz
frost-c2ca9066c6fd760bd6ef5d2f8f0530a89bfa7b66.tar.bz2
frost-c2ca9066c6fd760bd6ef5d2f8f0530a89bfa7b66.zip
WIP: Feature/pip video 2 (#405)
* Add dependency * Test new video view * Add initial video bindings * Implement drag to dismiss * Begin initial integration * Fix typo * Fix up url formatter * Update changelog * Create first fully integrated video build * Update translations * Update translations 2
Diffstat (limited to 'app/src/main/assets/js/click_a.js')
-rw-r--r--app/src/main/assets/js/click_a.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/assets/js/click_a.js b/app/src/main/assets/js/click_a.js
index 24a08f56..2f5d759f 100644
--- a/app/src/main/assets/js/click_a.js
+++ b/app/src/main/assets/js/click_a.js
@@ -12,6 +12,7 @@ if (!window.hasOwnProperty('frost_click_a')) {
* Commonality; check for valid target
*/
var element = e.target || e.srcElement;
+
if (element.tagName !== 'A') element = element.parentNode;
//Notifications is two layers under
if (element.tagName !== 'A') element = element.parentNode;
@@ -41,11 +42,14 @@ if (!window.hasOwnProperty('frost_click_a')) {
document.addEventListener('click', _frostAClick, true);
+ var clickTimeout;
+
document.addEventListener('touchstart', function _frostStart(e) {
- setTimeout(_frostPreventClick, 400);
+ clickTimeout = setTimeout(_frostPreventClick, 400);
}, true);
document.addEventListener('touchend', function _frostEnd(e) {
prevented = false;
+ clearTimeout(clickTimeout);
}, true);
}