summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuso Lapinlampi <wub@partyvan.eu>2015-09-27 18:00:12 +0200
committerJuuso Lapinlampi <wub@partyvan.eu>2015-09-27 18:14:32 +0200
commit8d9f781514cdb07a33e2dbaa3431928f0e08733b (patch)
tree4282f82492b8aa6adf44bf48a5d2559e0ec5084e
parent64bc5c47da06fbb6b638f2c95e44f081089fc7c3 (diff)
Use strict node === node.parentNode comparison
Fixes ESLint no-cond-assign warning. -- Sat, 26 Sep 2015 -- 10:38:42 +bursey | while (node = node.parentNode) is invalid 10:38:54 +bursey | should be while (node == node.parentNode) 10:40:38 +bursey | weird actually 10:40:55 +bursey | Elements tend to be "true" in js 10:41:16 +bursey | but if the parentNode is undefined, then it's | false 10:41:50 +bursey | thus it doesn't loop infinitely 10:43:00 +bursey | actually, use === instead of ==
-rw-r--r--js/pomf.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/pomf.js b/js/pomf.js
index bdd3174..bb14e15 100644
--- a/js/pomf.js
+++ b/js/pomf.js
@@ -56,7 +56,7 @@ $(function() {
$(this).html(btnContent);
break;
}
- } while (node = node.parentNode);
+ } while (node === node.parentNode);
});
var MAX_SIZE = (function(node) {