aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src
diff options
context:
space:
mode:
authorGravatar Flowers Safety2016-07-30 17:01:14 +0600
committerGravatar Flowers Safety2016-07-30 17:02:43 +0600
commit1a0bbe1ccd1f53276efa7228f1befcf0f2fa13bb (patch)
tree6cd8923e0eed5e4316bdc67d4e8e324c5bbaef89 /juick-www/src
parentc47199cabd70ba6fb1bc8f617b1995bb3216155c (diff)
match
Diffstat (limited to 'juick-www/src')
-rw-r--r--juick-www/src/main/static/scripts.js29
1 files changed, 16 insertions, 13 deletions
diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js
index b06ddab0..1c6e764e 100644
--- a/juick-www/src/main/static/scripts.js
+++ b/juick-www/src/main/static/scripts.js
@@ -703,20 +703,23 @@ ready(function () {
});
}
document.querySelectorAll('article').forEach(function(article) {
- article.querySelectorAll('.u a').forEach(function(l) {
- if (l.textContent === 'NSFW') {
- var img = article.querySelector('.ir img');
- if (img) {
- img.style.opacity = 0.05;
- img.addEventListener('mouseover', function(e) {
- e.target.style.opacity = 1;
- });
- img.addEventListener('mouseout', function(e) {
- e.target.style.opacity = 0.05;
- });
- }
+ if (Array.prototype.some.call(
+ article.querySelectorAll('.u a'),
+ function (a) {
+ return a.textContent === 'NSFW';
}
- });
+ )) {
+ var img = article.querySelector('.ir img');
+ if (img) {
+ img.style.opacity = 0.05;
+ img.addEventListener('mouseover', function(e) {
+ e.target.style.opacity = 1;
+ });
+ img.addEventListener('mouseout', function(e) {
+ e.target.style.opacity = 0.05;
+ });
+ }
+ }
});
unfoldPostForm();