文本框点击判断
This commit is contained in:
@ -69,6 +69,17 @@ class TextBox extends Base {
|
||||
that.textDom = dom;
|
||||
|
||||
}
|
||||
async isClick(posi, id) {
|
||||
let params = [
|
||||
{
|
||||
position: posi
|
||||
},
|
||||
id,
|
||||
null
|
||||
]
|
||||
|
||||
this.clickCallBack({ position: posi }, id, null)
|
||||
}
|
||||
async setHandeler(data) {
|
||||
let that = this
|
||||
|
||||
@ -118,6 +129,16 @@ class TextBox extends Base {
|
||||
async returnFun() {
|
||||
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() {
|
||||
return this.options.show
|
||||
}
|
||||
|
@ -436,6 +436,7 @@ class YJEarth {
|
||||
textList[i].style['pointer-events'] = 'all'
|
||||
textList[i].querySelector('textarea').focus()
|
||||
_this.isLeftClick = true
|
||||
_this.entityMap.get(_this.clickTextDom.id).isClick(movement.position, _this.clickTextDom.id)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user