diff options
author | Allan Wang <me@allanwang.ca> | 2019-02-05 22:44:47 -0500 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-02-05 22:44:47 -0500 |
commit | 8b850711ceb7c38f9368ce840831c1c0bdb4ba74 (patch) | |
tree | fb0bbd6a5428f344497858b7c4ca54954226f113 /app/src/web/assets/js/context_a.js | |
parent | 87469aba96cee61b4252d9a6d023324598355244 (diff) | |
download | frost-8b850711ceb7c38f9368ce840831c1c0bdb4ba74.tar.gz frost-8b850711ceb7c38f9368ce840831c1c0bdb4ba74.tar.bz2 frost-8b850711ceb7c38f9368ce840831c1c0bdb4ba74.zip |
Add log and strict equality
Diffstat (limited to 'app/src/web/assets/js/context_a.js')
-rw-r--r-- | app/src/web/assets/js/context_a.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/src/web/assets/js/context_a.js b/app/src/web/assets/js/context_a.js index 0573a17a..d0f5c622 100644 --- a/app/src/web/assets/js/context_a.js +++ b/app/src/web/assets/js/context_a.js @@ -2,11 +2,11 @@ (function () { var longClick = false; var _frostCopyPost = function (e, target) { - if (target.tagName != 'A') { + if (target.tagName !== 'A') { return false; } var parent1 = target.parentElement; - if (!parent1 || parent1.tagName != 'DIV') { + if (!parent1 || parent1.tagName !== 'DIV') { return false; } var parent2 = parent1.parentElement; @@ -15,21 +15,22 @@ } var url = target.getAttribute('href'); var text = parent1.innerText; + console.log("Copy post " + url + " " + text); Frost.contextMenu(url, text); return true; }; var _frostImage = function (e, target) { var element = target; for (var i = 0; i < 2; i++) { - if (element.tagName != 'A') { + if (element.tagName !== 'A') { element = element.parentElement; } } - if (element.tagName != 'A') { + if (element.tagName !== 'A') { return false; } var url = element.getAttribute('href'); - if (!url || url == '#') { + if (!url || url === '#') { return false; } var text = element.parentElement.innerText; |