文本框点击判断
This commit is contained in:
@ -69,6 +69,17 @@ class TextBox extends Base {
|
|||||||
that.textDom = dom;
|
that.textDom = dom;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
async isClick(posi, id) {
|
||||||
|
let params = [
|
||||||
|
{
|
||||||
|
position: posi
|
||||||
|
},
|
||||||
|
id,
|
||||||
|
null
|
||||||
|
]
|
||||||
|
|
||||||
|
this.clickCallBack({ position: posi }, id, null)
|
||||||
|
}
|
||||||
async setHandeler(data) {
|
async setHandeler(data) {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
||||||
@ -118,6 +129,16 @@ class TextBox extends Base {
|
|||||||
async returnFun() {
|
async returnFun() {
|
||||||
return this.handler
|
return this.handler
|
||||||
}
|
}
|
||||||
|
get onClick() {
|
||||||
|
return this.clickCallBack
|
||||||
|
}
|
||||||
|
set onClick(val) {
|
||||||
|
if (val && typeof val !== 'function') {
|
||||||
|
console.error('val:', val, '不是一个function')
|
||||||
|
} else {
|
||||||
|
this.clickCallBack = val
|
||||||
|
}
|
||||||
|
}
|
||||||
get show() {
|
get show() {
|
||||||
return this.options.show
|
return this.options.show
|
||||||
}
|
}
|
||||||
|
@ -62,9 +62,9 @@ class YJEarth {
|
|||||||
|
|
||||||
removeIncetance(id) {
|
removeIncetance(id) {
|
||||||
this.entityMap.delete(id)
|
this.entityMap.delete(id)
|
||||||
unRegLeftClickCallback(this,id)
|
unRegLeftClickCallback(this, id)
|
||||||
unRegRightClickCallback(this,id)
|
unRegRightClickCallback(this, id)
|
||||||
unregMoveCallback(this,id)
|
unregMoveCallback(this, id)
|
||||||
|
|
||||||
syncSplitData(this, id)
|
syncSplitData(this, id)
|
||||||
}
|
}
|
||||||
@ -436,6 +436,7 @@ class YJEarth {
|
|||||||
textList[i].style['pointer-events'] = 'all'
|
textList[i].style['pointer-events'] = 'all'
|
||||||
textList[i].querySelector('textarea').focus()
|
textList[i].querySelector('textarea').focus()
|
||||||
_this.isLeftClick = true
|
_this.isLeftClick = true
|
||||||
|
_this.entityMap.get(_this.clickTextDom.id).isClick(movement.position, _this.clickTextDom.id)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user