修复layer在容器不是document.body时关闭异常的bug;修复layer.load回调this指向错误的bug;修改layer遮罩颜色默认为透明
parent
c982f33858
commit
bdb61f4f7a
|
@ -191,7 +191,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.mask {position:fixed;z-index:65534;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,.3);
|
&.mask {position:fixed;z-index:65534;left:0;top:0;width:100%;height:100%;background:transparent;
|
||||||
|
|
||||||
&.shift {transition: all .5s ease-out;}
|
&.shift {transition: all .5s ease-out;}
|
||||||
&.inner {position:absolute;}
|
&.inner {position:absolute;}
|
||||||
|
|
|
@ -58,16 +58,11 @@ const close = function(id) {
|
||||||
layerDom[id][1].classList.add('shift')
|
layerDom[id][1].classList.add('shift')
|
||||||
layerDom[id][0].style.opacity = ''
|
layerDom[id][0].style.opacity = ''
|
||||||
layerDom[id][1].style.opacity = 0
|
layerDom[id][1].style.opacity = 0
|
||||||
setTimeout(
|
setTimeout(function() {
|
||||||
(_ => {
|
layerDom[id][0].parentNode.removeChild(layerDom[id][0])
|
||||||
return function() {
|
delete layerDom[id]
|
||||||
document.body.removeChild(layerDom[_][0])
|
delete Anot.vmodels[id]
|
||||||
delete layerDom[_]
|
}, 200)
|
||||||
delete Anot.vmodels[_]
|
|
||||||
}
|
|
||||||
})(id),
|
|
||||||
200
|
|
||||||
)
|
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
}
|
}
|
||||||
document.body.style.overflow = ''
|
document.body.style.overflow = ''
|
||||||
|
@ -510,12 +505,12 @@ class __layer__ {
|
||||||
|
|
||||||
// 为loading类型时,自动关闭同时触发回调
|
// 为loading类型时,自动关闭同时触发回调
|
||||||
if (state.type === 6) {
|
if (state.type === 6) {
|
||||||
this.vm.props.yes($id)
|
this.vm.props.yes.call(this.vm, $id)
|
||||||
}
|
}
|
||||||
}, state.timeout)
|
}, state.timeout)
|
||||||
} else if (state.type === 6) {
|
} else if (state.type === 6) {
|
||||||
// loading类型, 非自动关闭时, 主动触发回调
|
// loading类型, 非自动关闭时, 主动触发回调
|
||||||
this.vm.props.yes($id)
|
this.vm.props.yes.call(this.vm, $id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ const addon = {
|
||||||
type: 7,
|
type: 7,
|
||||||
menubar: false,
|
menubar: false,
|
||||||
maskClose: true,
|
maskClose: true,
|
||||||
maskColor: 'rgba(255,255,255,0)',
|
|
||||||
fixed: true,
|
fixed: true,
|
||||||
insert: function(level) {
|
insert: function(level) {
|
||||||
wrap = wrap.replace(/^(#{1,6} )?/, '#'.repeat(level) + ' ')
|
wrap = wrap.replace(/^(#{1,6} )?/, '#'.repeat(level) + ' ')
|
||||||
|
@ -113,7 +112,6 @@ const addon = {
|
||||||
type: 7,
|
type: 7,
|
||||||
menubar: false,
|
menubar: false,
|
||||||
maskClose: true,
|
maskClose: true,
|
||||||
maskColor: 'rgba(255,255,255,0)',
|
|
||||||
fixed: true,
|
fixed: true,
|
||||||
link: '',
|
link: '',
|
||||||
linkName: wrap,
|
linkName: wrap,
|
||||||
|
@ -188,7 +186,6 @@ const addon = {
|
||||||
title: '插入表情',
|
title: '插入表情',
|
||||||
fixed: true,
|
fixed: true,
|
||||||
maskClose: true,
|
maskClose: true,
|
||||||
maskColor: 'rgba(255,255,255,0)',
|
|
||||||
arr: [
|
arr: [
|
||||||
'😀',
|
'😀',
|
||||||
'😅',
|
'😅',
|
||||||
|
@ -257,7 +254,6 @@ const addon = {
|
||||||
title: '0行 x 0列',
|
title: '0行 x 0列',
|
||||||
fixed: true,
|
fixed: true,
|
||||||
maskClose: true,
|
maskClose: true,
|
||||||
maskColor: 'rgba(255,255,255,0)',
|
|
||||||
offset: [
|
offset: [
|
||||||
offset.top + 35 - $doc.scrollTop(),
|
offset.top + 35 - $doc.scrollTop(),
|
||||||
'auto',
|
'auto',
|
||||||
|
@ -336,7 +332,6 @@ const addon = {
|
||||||
type: 7,
|
type: 7,
|
||||||
menubar: false,
|
menubar: false,
|
||||||
maskClose: true,
|
maskClose: true,
|
||||||
maskColor: 'rgba(255,255,255,0)',
|
|
||||||
fixed: true,
|
fixed: true,
|
||||||
img: '',
|
img: '',
|
||||||
imgAlt: wrap,
|
imgAlt: wrap,
|
||||||
|
@ -481,7 +476,6 @@ const addon = {
|
||||||
type: 7,
|
type: 7,
|
||||||
title: '关于编辑器',
|
title: '关于编辑器',
|
||||||
maskClose: true,
|
maskClose: true,
|
||||||
maskColor: 'rgba(255,255,255,0)',
|
|
||||||
offset: [offset.top + 35 - $doc.scrollTop()],
|
offset: [offset.top + 35 - $doc.scrollTop()],
|
||||||
shift: { top: offset.top - $doc.scrollTop() },
|
shift: { top: offset.top - $doc.scrollTop() },
|
||||||
content:
|
content:
|
||||||
|
|
Reference in New Issue