OSDN Git Service

Version 0.6.147, fix X.UA & X.URL & X.EventDispatcher & X.XHR.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 13_XEventDispatcher.js
index 0b83d8d..612268f 100644 (file)
@@ -192,7 +192,7 @@ var X_EventDispatcher = X[ 'EventDispatcher' ] =
                                \r
                                if( opt_type === undefined ) return !!listeners;\r
                                if( !listeners || !( list = listeners[ opt_type ] ) ) return false;\r
-                               if( opt_arg1 === undefined ) return true;\r
+                               if( opt_arg1 === undefined ) return X_EventDispatcher_needsIndex ? 0 : true;\r
                                \r
                                if( opt_arg1.kind ){\r
                                        cbHash = opt_arg1;\r
@@ -494,7 +494,7 @@ function X_EventDispatcher_unlisten( opt_type, opt_arg1, opt_arg2, opt_arg3 ){
                                empty = false;\r
                                break;\r
                        };\r
-                       if( raw && !X_String_isNumberString( opt_type ) ){ // 数字イベントの除外\r
+                       if( raw && !X_String_isNumberString( '' + opt_type ) ){ // 数字イベントの除外\r
                                X_EventDispatcher_removeEvent( this, opt_type, raw, list, !empty );\r
                        };\r
                        if( empty ) delete this[ '_listeners' ];\r
@@ -592,6 +592,7 @@ var X_EventDispatcher_actualAddEvent =
                                        break;                          \r
                                \r
                                case X_EventDispatcher_EVENT_TARGET_XHR :\r
+                                       console.log( 'XHR addEvent ' + type );\r
                                        // ie8- の XHR は window.event が更新されないため, eventType 毎に callback を指定する\r
                                        raw[ 'on' + type ] = X_Callback_create( that, X_EventDispatcher_dispatch, [ type ] );\r
                                        break;\r
@@ -710,6 +711,7 @@ var X_EventDispatcher_actualRemoveEvent =
                                        X_Callback_correct( raw[ 'on' + type ] );\r
                                        raw[ 'on' + type ] = X_emptyFunction;\r
                                        raw[ 'on' + type ] = '';\r
+                                       console.log( 'XHR rmEvent ' + type );\r
                                        break;\r
 \r
                                default :\r