summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-20 20:13:42 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-20 20:13:42 +0900
commit2a3a5d4b509e527d1871b6a993f49b29c734c268 (patch)
tree32fdf8c3ea5337c2a1d71f1017de54c7cfe6471b /src/web/app/common/scripts
parentwip (diff)
downloadsharkey-2a3a5d4b509e527d1871b6a993f49b29c734c268.tar.gz
sharkey-2a3a5d4b509e527d1871b6a993f49b29c734c268.tar.bz2
sharkey-2a3a5d4b509e527d1871b6a993f49b29c734c268.zip
wip
Diffstat (limited to 'src/web/app/common/scripts')
-rw-r--r--src/web/app/common/scripts/contains.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/web/app/common/scripts/contains.js b/src/web/app/common/scripts/contains.js
new file mode 100644
index 0000000000..fe73666193
--- /dev/null
+++ b/src/web/app/common/scripts/contains.js
@@ -0,0 +1,8 @@
+module.exports = function(parent, child) {
+ let node = child.parentNode;
+ while (node) {
+ if (node == parent) return true;
+ node = node.parentNode;
+ }
+ return false;
+}