From ae46dca6dec813658cfd5fc2f89101d78fa86d19 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Wed, 10 Feb 2016 13:12:29 -0500 Subject: [PATCH] cc.EditBoxDelegate fix `JSB_EditBoxDelegate` and `cc.EditBox.setDelegate` were implemented in C++. Right now, `setDelegate` can receive a simple plain object and it works perfectly, but the `cc.EditBoxDelegate` object that exists in HTML5 doesn't exist in JSB. I'm simply creating it the way it is created in HTML5. --- script/jsb.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/jsb.js b/script/jsb.js index 1ae745a..a635651 100644 --- a/script/jsb.js +++ b/script/jsb.js @@ -54,6 +54,13 @@ if (window.ccs) { } if (window.ccui) { + cc.EditBoxDelegate = cc.Class.extend({ + editBoxEditingDidBegin: function (sender) {}, + editBoxEditingDidEnd: function (sender) {}, + editBoxTextChanged: function (sender, text) {}, + editBoxReturn: function (sender) {} + }); + // move from jsb_boot.js line 912 //start------------------------------ cc.EditBox = ccui.EditBox; @@ -136,4 +143,4 @@ if (jsb.Sprite3D){ if (jsb.ParticleSystem3D) { require('script/3d/jsb_cocos2d_3d_ext.js'); -} \ No newline at end of file +}