Sign in

徐烜 / bsth-ebus-h5_editor · Files

GitLab

  • Go to dashboard
  • Project
  • Activity
  • Files
  • Commits
  • Builds 0
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • bsth-ebus-h5_editor
  • front-end
  • h5
  • src
  • utils
  • dom-helper.js
  • perf(contextmenu) hide contextmenu when mouse leave outside
    ada722c1
    ly525 authored
    2019-10-19 12:38:52 +0800  
    Browse Code »
dom-helper.js 167 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11
export function contains (root, n) {
  let node = n
  while (node) {
    if (node === root) {
      return true
    }
    node = node.parentNode
  }

  return false
}