mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Merge pull request #629 from zilongshanren/fix-jsb-editbox-callback-v1.0
fix editbox begin and end callback not called.
This commit is contained in:
@@ -465,8 +465,10 @@ var EditBox = cc.Class({
|
||||
},
|
||||
|
||||
_registerEvent: function () {
|
||||
this.node.on(cc.Node.EventType.TOUCH_START, this._onTouchBegan, this);
|
||||
this.node.on(cc.Node.EventType.TOUCH_END, this._onTouchEnded, this);
|
||||
if(!CC_JSB) {
|
||||
this.node.on(cc.Node.EventType.TOUCH_START, this._onTouchBegan, this);
|
||||
this.node.on(cc.Node.EventType.TOUCH_END, this._onTouchEnded, this);
|
||||
}
|
||||
},
|
||||
|
||||
_onTouchBegan: function(event) {
|
||||
@@ -485,4 +487,14 @@ var EditBox = cc.Class({
|
||||
|
||||
});
|
||||
|
||||
if(CC_JSB) {
|
||||
EditBox.prototype.editBoxEditingDidBegin = function (sender) {
|
||||
this.editBoxEditingDidBegan(sender);
|
||||
}
|
||||
|
||||
EditBox.prototype.editBoxEditingDidEnd = function (sender) {
|
||||
this.editBoxEditingDidEnded(sender);
|
||||
}
|
||||
}
|
||||
|
||||
cc.EditBox = module.exports = EditBox;
|
||||
|
||||
@@ -50,16 +50,6 @@ _p.setMaxLength = function(maxLength) {
|
||||
this._setMaxLength(maxLength);
|
||||
}
|
||||
|
||||
_p.editBoxEditingDidBegin = function (sender) {
|
||||
this.editBoxEditingDidBegan(sender);
|
||||
}
|
||||
_p.editBoxEditingDidEnd = function (sender) {
|
||||
this.editBoxEditingDidEnded(sender);
|
||||
}
|
||||
|
||||
_p._onTouchBegan = function() {}
|
||||
_p._onTouchEnded = function() {}
|
||||
|
||||
_p.setLineHeight = function () {}
|
||||
|
||||
_p = null;
|
||||
|
||||
Reference in New Issue
Block a user