From bdb61f4f7a7f37c45f4253468bb8fc5017c53d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Tue, 7 Aug 2018 01:54:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlayer=E5=9C=A8=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E4=B8=8D=E6=98=AFdocument.body=E6=97=B6=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=BC=82=E5=B8=B8=E7=9A=84bug;=E4=BF=AE=E5=A4=8Dlayer?= =?UTF-8?q?.load=E5=9B=9E=E8=B0=83this=E6=8C=87=E5=90=91=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84bug;=E4=BF=AE=E6=94=B9layer=E9=81=AE=E7=BD=A9=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E9=BB=98=E8=AE=A4=E4=B8=BA=E9=80=8F=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/css/layer-normal.scss | 2 +- src/layer/index.js | 19 +++++++------------ src/meditor/addon/base.js | 6 ------ 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/css/layer-normal.scss b/src/css/layer-normal.scss index 07fb98c..884e660 100644 --- a/src/css/layer-normal.scss +++ b/src/css/layer-normal.scss @@ -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;} diff --git a/src/layer/index.js b/src/layer/index.js index 59a49bd..c6dbeb8 100644 --- a/src/layer/index.js +++ b/src/layer/index.js @@ -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) } } } diff --git a/src/meditor/addon/base.js b/src/meditor/addon/base.js index 6fb9ae5..31701db 100644 --- a/src/meditor/addon/base.js +++ b/src/meditor/addon/base.js @@ -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: