This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

修复layer在容器不是document.body时关闭异常的bug;修复layer.load回调this指向错误的bug;修改layer遮罩颜色默认为透明

old
宇天 2018-08-07 01:54:05 +08:00
parent c982f33858
commit bdb61f4f7a
3 changed files with 8 additions and 19 deletions

View File

@ -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;}
&.inner {position:absolute;}

View File

@ -58,16 +58,11 @@ const close = function(id) {
layerDom[id][1].classList.add('shift')
layerDom[id][0].style.opacity = ''
layerDom[id][1].style.opacity = 0
setTimeout(
(_ => {
return function() {
document.body.removeChild(layerDom[_][0])
delete layerDom[_]
delete Anot.vmodels[_]
}
})(id),
200
)
setTimeout(function() {
layerDom[id][0].parentNode.removeChild(layerDom[id][0])
delete layerDom[id]
delete Anot.vmodels[id]
}, 200)
} catch (err) {}
}
document.body.style.overflow = ''
@ -510,12 +505,12 @@ class __layer__ {
// 为loading类型时,自动关闭同时触发回调
if (state.type === 6) {
this.vm.props.yes($id)
this.vm.props.yes.call(this.vm, $id)
}
}, state.timeout)
} else if (state.type === 6) {
// loading类型, 非自动关闭时, 主动触发回调
this.vm.props.yes($id)
this.vm.props.yes.call(this.vm, $id)
}
}
}

View File

@ -31,7 +31,6 @@ const addon = {
type: 7,
menubar: false,
maskClose: true,
maskColor: 'rgba(255,255,255,0)',
fixed: true,
insert: function(level) {
wrap = wrap.replace(/^(#{1,6} )?/, '#'.repeat(level) + ' ')
@ -113,7 +112,6 @@ const addon = {
type: 7,
menubar: false,
maskClose: true,
maskColor: 'rgba(255,255,255,0)',
fixed: true,
link: '',
linkName: wrap,
@ -188,7 +186,6 @@ const addon = {
title: '插入表情',
fixed: true,
maskClose: true,
maskColor: 'rgba(255,255,255,0)',
arr: [
'😀',
'😅',
@ -257,7 +254,6 @@ const addon = {
title: '0行 x 0列',
fixed: true,
maskClose: true,
maskColor: 'rgba(255,255,255,0)',
offset: [
offset.top + 35 - $doc.scrollTop(),
'auto',
@ -336,7 +332,6 @@ const addon = {
type: 7,
menubar: false,
maskClose: true,
maskColor: 'rgba(255,255,255,0)',
fixed: true,
img: '',
imgAlt: wrap,
@ -481,7 +476,6 @@ const addon = {
type: 7,
title: '关于编辑器',
maskClose: true,
maskColor: 'rgba(255,255,255,0)',
offset: [offset.top + 35 - $doc.scrollTop()],
shift: { top: offset.top - $doc.scrollTop() },
content: