overscroll
Version:
42 lines (31 loc) • 849 B
JavaScript
;
exports.__esModule = true;
exports['default'] = function (scope) {
var target = scope.target,
axis = scope.axis,
hasX = scope.hasX,
hasY = scope.hasY,
setData = scope.domData.setData,
OVERSCROLL = scope.OVERSCROLL,
OVERSCROLLX = scope.OVERSCROLLX,
OVERSCROLLY = scope.OVERSCROLLY,
BUBBLE = scope.BUBBLE,
NOBUBBLE = scope.NOBUBBLE,
bubble = scope.bubble,
resetCache = scope.resetCache;
// 添加样式
(0, _css.set)(target, 'overflow', 'hidden');
// DOM 打上标记
setData(target, OVERSCROLL);
if (hasX(axis)) {
setData(target, OVERSCROLLX);
}
if (hasY(axis)) {
setData(target, OVERSCROLLY);
}
setData(target, bubble ? BUBBLE : NOBUBBLE);
// 初始化缓存
resetCache();
return scope;
};
var _css = require('./utils/css');