hide editbox input onDisable when stayOnTop (#3129)

This commit is contained in:
PP
2018-08-22 14:47:29 +08:00
committed by pandamicro
parent 1d8f3bb5f9
commit f5b81db4c2
2 changed files with 27 additions and 0 deletions
@@ -577,6 +577,14 @@ let EditBox = cc.Class({
this._impl.clear();
},
onEnable () {
this._impl && this._impl.onEnable();
},
onDisable () {
this._impl && this._impl.onDisable();
},
__preload () {
if (!CC_EDITOR) {
this._registerEvent();
@@ -93,6 +93,25 @@ let EditBoxImpl = cc.Class({
this.__orientationChanged = null;
},
onEnable () {
if (!this._edTxt) {
return;
}
if (this._alwaysOnTop) {
this._edTxt.style.display = '';
}
else {
this._edTxt.style.display = 'none';
}
},
onDisable () {
if (!this._edTxt) {
return;
}
this._edTxt.style.display = 'none';
},
setTabIndex (index) {
if (this._edTxt) {
this._edTxt.tabIndex = index;