[improvement] update eslint config (#2288)

This commit is contained in:
neverland
2018-12-14 14:24:23 +08:00
committed by GitHub
parent d2751ffdfa
commit 16e4889a92
141 changed files with 6387 additions and 7536 deletions

View File

@@ -1,16 +1,16 @@
import { isServer } from './';
import { isServer } from '.';
export default {
// get nearest scroll element
getScrollEventTarget(element, rootParent = window) {
let currentNode = element;
let node = element;
// bugfix, see http://w3help.org/zh-cn/causes/SD9013 and http://stackoverflow.com/questions/17016740/onscroll-function-is-not-working-for-chrome
while (currentNode && currentNode.tagName !== 'HTML' && currentNode.tagName !== 'BODY' && currentNode.nodeType === 1 && currentNode !== rootParent) {
const overflowY = this.getComputedStyle(currentNode).overflowY;
while (node && node.tagName !== 'HTML' && node.tagName !== 'BODY' && node.nodeType === 1 && node !== rootParent) {
const { overflowY } = this.getComputedStyle(node);
if (overflowY === 'scroll' || overflowY === 'auto') {
return currentNode;
return node;
}
currentNode = currentNode.parentNode;
node = node.parentNode;
}
return rootParent;
},