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:
Jare Guo
2016-04-25 18:32:21 +08:00
2 changed files with 14 additions and 12 deletions
+14 -2
View File
@@ -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;
-10
View File
@@ -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;