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
|
@ -283,20 +283,26 @@ cc.dumpConfig = function () {
|
||||||
// Bindings Overrides
|
// Bindings Overrides
|
||||||
//
|
//
|
||||||
// MenuItemToggle
|
// MenuItemToggle
|
||||||
cc.MenuItemToggle.create = function (/* var args */) {
|
cc.MenuItemToggle.create = function( /* var args */) {
|
||||||
|
|
||||||
var n = arguments.length;
|
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 args = Array.prototype.slice.call(arguments);
|
||||||
|
var obj = null;
|
||||||
|
if( typeof arguments[n-2] === 'function' )
|
||||||
|
obj = args.pop();
|
||||||
|
|
||||||
var func = args.pop();
|
var func = args.pop();
|
||||||
var obj = args.pop();
|
|
||||||
|
|
||||||
// create it with arguments,
|
// create it with arguments,
|
||||||
var item = cc.MenuItemToggle._create.apply(this, args);
|
var item = cc.MenuItemToggle._create.apply(this, args);
|
||||||
|
|
||||||
// then set the callback
|
// then set the callback
|
||||||
item.setCallback(obj, func);
|
if( obj !== null )
|
||||||
|
item.setCallback(func, obj);
|
||||||
|
else
|
||||||
|
item.setCallback(func);
|
||||||
return item;
|
return item;
|
||||||
} else {
|
} else {
|
||||||
return cc.MenuItemToggle._create.apply(this, arguments);
|
return cc.MenuItemToggle._create.apply(this, arguments);
|
||||||
|
@ -304,17 +310,16 @@ cc.MenuItemToggle.create = function (/* var args */) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// LabelAtlas
|
// 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) {
|
if ( n == 5) {
|
||||||
// return cc.LabelAtlas._create(a, b, c, d, e.charCodeAt(0));
|
return cc.LabelAtlas._create(a,b,c,d,e.charCodeAt(0));
|
||||||
// } else {
|
} else {
|
||||||
// return cc.LabelAtlas._create.apply(this, arguments);
|
return cc.LabelAtlas._create.apply(this, arguments);
|
||||||
// }
|
}
|
||||||
// };
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Associates a base class with a native superclass
|
* Associates a base class with a native superclass
|
||||||
|
|
|
@ -37,7 +37,7 @@ cc.Reader.load = function(file, owner, parentSize)
|
||||||
var callbackName = ownerCallbackNames[i];
|
var callbackName = ownerCallbackNames[i];
|
||||||
var callbackNode = ownerCallbackNodes[i];
|
var callbackNode = ownerCallbackNodes[i];
|
||||||
|
|
||||||
callbackNode.setCallback(owner, owner[callbackName]);
|
callbackNode.setCallback(owner[callbackName], owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
|
@ -83,7 +83,7 @@ cc.Reader.load = function(file, owner, parentSize)
|
||||||
var callbackName = documentCallbackNames[j];
|
var callbackName = documentCallbackNames[j];
|
||||||
var callbackNode = documentCallbackNodes[j];
|
var callbackNode = documentCallbackNodes[j];
|
||||||
|
|
||||||
callbackNode.setCallback(controller, controller[callbackName]);
|
callbackNode.setCallback(controller[callbackName], controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue