...
|
...
|
@@ -10,10 +10,12 @@ |
|
|
const $ = require('jquery');
|
|
|
|
|
|
const ANIMATIONS = {
|
|
|
none: { in : 'overlay-in',
|
|
|
none: {
|
|
|
in: 'overlay-in',
|
|
|
out: 'overlay-out'
|
|
|
},
|
|
|
fade: { in : 'overlay-fade-in',
|
|
|
fade: {
|
|
|
in: 'overlay-fade-in',
|
|
|
out: 'overlay-fade-out'
|
|
|
}
|
|
|
};
|
...
|
...
|
@@ -28,7 +30,8 @@ class Overlay { |
|
|
clickToClose: true, // 点击关闭
|
|
|
onClose: $.noop, // 关闭回调函数
|
|
|
animation: 'fade', // 动画效果
|
|
|
disableScrolling: true // 是否禁止
|
|
|
disableScrolling: true, // 是否禁止
|
|
|
disableTouchMove: false
|
|
|
};
|
|
|
|
|
|
// 初始化参数
|
...
|
...
|
@@ -49,7 +52,7 @@ class Overlay { |
|
|
}
|
|
|
});
|
|
|
|
|
|
if (this.settings.disableScrolling) {
|
|
|
if (this.settings.disableScrolling && this.settings.disableTouchMove) {
|
|
|
// 覆盖层出现时阻止滚动
|
|
|
document.body.addEventListener('touchmove', (e) => {
|
|
|
if (this.isVisible) {
|
...
|
...
|
|