|
@@ -1,12 +1,9 @@
|
|
|
var utils = require('../utils')
|
|
var utils = require('../utils')
|
|
|
|
|
|
|
|
-function delegateCheck (current, top, identifier) {
|
|
|
|
|
- if (current[identifier]) {
|
|
|
|
|
- return current
|
|
|
|
|
- } else if (current === top || !current.parentNode) {
|
|
|
|
|
- return false
|
|
|
|
|
- } else {
|
|
|
|
|
- return delegateCheck(current.parentNode, top, identifier)
|
|
|
|
|
|
|
+function delegateCheck (el, root, identifier) {
|
|
|
|
|
+ while (el && el !== root) {
|
|
|
|
|
+ if (el[identifier]) return el
|
|
|
|
|
+ el = el.parentNode
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|