@@ -161,23 +161,23 @@ _p._ctor = function(value, callback, target) {
161
161
162
162
_p = cc . MenuItemSprite . prototype ;
163
163
_p . _ctor = function ( normalSprite , selectedSprite , three , four , five ) {
164
- var argc = arguments . length ;
165
- if ( argc > 1 ) {
166
- normalSprite = arguments [ 0 ] ;
167
- selectedSprite = arguments [ 1 ] ;
164
+ if ( selectedSprite ) {
165
+ normalSprite = normalSprite ;
166
+ selectedSprite = selectedSprite ;
168
167
var disabledImage , target , callback ;
169
- if ( argc == 5 ) {
170
- disabledImage = arguments [ 2 ] ;
171
- callback = arguments [ 3 ] ;
172
- target = arguments [ 4 ] ;
173
- } else if ( argc == 4 && typeof arguments [ 3 ] === "function" ) {
174
- disabledImage = arguments [ 2 ] ;
175
- callback = arguments [ 3 ] ;
176
- } else if ( argc == 4 && typeof arguments [ 2 ] === "function" ) {
177
- target = arguments [ 3 ] ;
178
- callback = arguments [ 2 ] ;
179
- } else if ( argc <= 2 ) {
180
- disabledImage = arguments [ 2 ] ;
168
+ if ( five ) {
169
+ disabledImage = three ;
170
+ callback = four ;
171
+ target = five ;
172
+ } else if ( four && typeof four === "function" ) {
173
+ disabledImage = three ;
174
+ callback = four ;
175
+ } else if ( four && typeof three === "function" ) {
176
+ target = four ;
177
+ callback = three ;
178
+ disabledImage = normalSprite ;
179
+ } else if ( three === undefined ) {
180
+ disabledImage = normalSprite ;
181
181
}
182
182
callback = callback ? callback . bind ( target ) : null ;
183
183
this . initWithNormalSprite ( normalSprite , selectedSprite , disabledImage , callback ) ;
0 commit comments