mirror of https://github.com/axmolengine/axmol.git
issue #1549: Sync jsb_constants_cocos2d.js and jsb_constants_cocosbuilder.js to -iphone version.
This commit is contained in:
parent
270676b74d
commit
b72f922287
|
@ -287,16 +287,22 @@ cc.MenuItemToggle.create = function (/* var args */) {
|
|||
|
||||
var n = arguments.length;
|
||||
|
||||
if (typeof arguments[n - 1] === 'function') {
|
||||
if (typeof arguments[n-2] === 'function' || typeof arguments[n-1] === 'function') {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var obj = null;
|
||||
if( typeof arguments[n-2] === 'function' )
|
||||
obj = args.pop();
|
||||
|
||||
var func = args.pop();
|
||||
var obj = args.pop();
|
||||
|
||||
// create it with arguments,
|
||||
var item = cc.MenuItemToggle._create.apply(this, args);
|
||||
|
||||
// then set the callback
|
||||
item.setCallback(obj, func);
|
||||
if( obj !== null )
|
||||
item.setCallback(func, obj);
|
||||
else
|
||||
item.setCallback(func);
|
||||
return item;
|
||||
} else {
|
||||
return cc.MenuItemToggle._create.apply(this, arguments);
|
||||
|
@ -304,17 +310,16 @@ cc.MenuItemToggle.create = function (/* var args */) {
|
|||
};
|
||||
|
||||
// LabelAtlas
|
||||
// TODO:
|
||||
// cc.LabelAtlas.create = function (a, b, c, d, e) {
|
||||
cc.LabelAtlas.create = function( a,b,c,d,e ) {
|
||||
|
||||
// var n = arguments.length;
|
||||
var n = arguments.length;
|
||||
|
||||
// if (n == 5) {
|
||||
// return cc.LabelAtlas._create(a, b, c, d, e.charCodeAt(0));
|
||||
// } else {
|
||||
// return cc.LabelAtlas._create.apply(this, arguments);
|
||||
// }
|
||||
// };
|
||||
if ( n == 5) {
|
||||
return cc.LabelAtlas._create(a,b,c,d,e.charCodeAt(0));
|
||||
} else {
|
||||
return cc.LabelAtlas._create.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Associates a base class with a native superclass
|
||||
|
|
|
@ -37,7 +37,7 @@ cc.Reader.load = function(file, owner, parentSize)
|
|||
var callbackName = ownerCallbackNames[i];
|
||||
var callbackNode = ownerCallbackNodes[i];
|
||||
|
||||
callbackNode.setCallback(owner, owner[callbackName]);
|
||||
callbackNode.setCallback(owner[callbackName], owner);
|
||||
}
|
||||
|
||||
// Variables
|
||||
|
@ -83,7 +83,7 @@ cc.Reader.load = function(file, owner, parentSize)
|
|||
var callbackName = documentCallbackNames[j];
|
||||
var callbackNode = documentCallbackNodes[j];
|
||||
|
||||
callbackNode.setCallback(controller, controller[callbackName]);
|
||||
callbackNode.setCallback(controller[callbackName], controller);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue