diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-20 20:13:42 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-20 20:13:42 +0900 |
| commit | 2a3a5d4b509e527d1871b6a993f49b29c734c268 (patch) | |
| tree | 32fdf8c3ea5337c2a1d71f1017de54c7cfe6471b /src/web/app/common/scripts | |
| parent | wip (diff) | |
| download | sharkey-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.js | 8 |
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; +} |