4.0bug修改
This commit is contained in:
109
static/sdk/3rdparty/ewPlugins.min.js
vendored
109
static/sdk/3rdparty/ewPlugins.min.js
vendored
@ -810,6 +810,7 @@
|
||||
else
|
||||
this.init(o, this.config)
|
||||
}
|
||||
this.changeColor = g
|
||||
this.close = () => {
|
||||
this.pickerFlag = !this.pickerFlag,
|
||||
this.picker.style.opacity = 0
|
||||
@ -827,39 +828,83 @@
|
||||
this.uid = uid
|
||||
_this.box.setAttribute("color-box-id", uid)
|
||||
function clickEvent(event) {
|
||||
if(!document.contains(_this.box)) {
|
||||
document.removeEventListener('click', clickEvent);
|
||||
}
|
||||
// 检查点击事件是否发生在核心元素或其子元素之外
|
||||
let boxNode
|
||||
function recursion(node) {
|
||||
if(!node.parentNode) {
|
||||
boxNode = node
|
||||
}
|
||||
else {
|
||||
if(node.getAttribute("color-box-id") === uid) {
|
||||
boxNode = node
|
||||
}
|
||||
else {
|
||||
recursion(node.parentNode)
|
||||
}
|
||||
}
|
||||
}
|
||||
recursion(event.target)
|
||||
if(!boxNode) {
|
||||
if(_this.pickerFlag) {
|
||||
_this.close()
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!boxNode.getAttribute || boxNode.getAttribute("color-box-id") !== uid) {
|
||||
if(_this.pickerFlag) {
|
||||
_this.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('------------')
|
||||
|
||||
}
|
||||
document.addEventListener('click', clickEvent);
|
||||
let mousedownEln
|
||||
let mouseupEln
|
||||
let flag = false
|
||||
function mousedownEvent(event) {
|
||||
flag = false
|
||||
if(!document.contains(_this.box)) {
|
||||
document.removeEventListener('mousedown', mousedownEvent);
|
||||
}
|
||||
// 检查点击事件是否发生在核心元素或其子元素之外
|
||||
let boxNode
|
||||
function recursion(node) {
|
||||
if(!node.parentNode) {
|
||||
boxNode = node
|
||||
}
|
||||
else {
|
||||
if(node.getAttribute("color-box-id") === uid) {
|
||||
boxNode = node
|
||||
}
|
||||
else {
|
||||
recursion(node.parentNode)
|
||||
}
|
||||
}
|
||||
}
|
||||
recursion(event.target)
|
||||
if(!boxNode) {
|
||||
if(_this.pickerFlag) {
|
||||
flag = true
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!boxNode.getAttribute || boxNode.getAttribute("color-box-id") !== uid) {
|
||||
if(_this.pickerFlag) {
|
||||
flag = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function mouseupEvent(event) {
|
||||
if(!document.contains(_this.box)) {
|
||||
document.removeEventListener('mouseup', mouseupEvent);
|
||||
}
|
||||
// 检查点击事件是否发生在核心元素或其子元素之外
|
||||
let boxNode
|
||||
function recursion(node) {
|
||||
if(!node.parentNode) {
|
||||
boxNode = node
|
||||
}
|
||||
else {
|
||||
if(node.getAttribute("color-box-id") === uid) {
|
||||
boxNode = node
|
||||
}
|
||||
else {
|
||||
recursion(node.parentNode)
|
||||
}
|
||||
}
|
||||
}
|
||||
recursion(event.target)
|
||||
if(!boxNode) {
|
||||
if(_this.pickerFlag && flag) {
|
||||
_this.close()
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!boxNode.getAttribute || boxNode.getAttribute("color-box-id") !== uid) {
|
||||
if(_this.pickerFlag && flag) {
|
||||
_this.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
flag = false
|
||||
}
|
||||
// document.addEventListener('click', clickEvent);
|
||||
document.addEventListener('mousedown', mousedownEvent);
|
||||
document.addEventListener('mouseup', mouseupEvent);
|
||||
return this
|
||||
}
|
||||
function h(e) {
|
||||
|
Reference in New Issue
Block a user