OSDN Git Service

Version 0.6.106, bugfix for X.EventDispatcher, cleanup X.Node, Image JSONP for Opera1...
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 13_XEventDispatcher.js
index 19a52af..7ff83b3 100644 (file)
@@ -57,6 +57,7 @@ X.EventDispatcher =
             * @memberof X.EventDispatcher\r
             */\r
 \r
+               // TODO _rawObjectType EventTarget, XHR, Silverlight, ...\r
                /**\r
                 * イベントリスナをイベント名(string)や数値(1~,フレームワーク内で定義)をキーとするArrayで記憶します。\r
                 * Arrayには、{k:種類,x:コンテキスト(thisObject),f:関数,s:サプリメントする引数の配列} というハッシュ、または関数が蓄えられています。\r
@@ -333,6 +334,8 @@ function X_EventDispatcher_dispatch( e ){
 function X_EventDispatcher_listen( type, opt_arg1, opt_arg2, opt_arg3 ){\r
        var list = this._listeners,\r
                i, raw, add, f;\r
+\r
+       if( !type ) return this;\r
        \r
        if( this._dispatching ){\r
                if( !this._reserves ) this._reserves = [];\r
@@ -350,7 +353,7 @@ function X_EventDispatcher_listen( type, opt_arg1, opt_arg2, opt_arg3 ){
        raw = this._rawObject || X_UA_DOM.IE4 && X_Node__ie4getRawNode( this );\r
        add = raw && ( !list || !list[ type ] ) && X.Type.isString( type );\r
        \r
-       if( this.listening( type, opt_arg1, opt_arg2, opt_arg3 ) ) return this;\r
+       if( this.listening( type, opt_arg1 || this, opt_arg2, opt_arg3 ) ) return this;\r
 \r
        if( !list ) list = this._listeners = {};\r
        if( !( list = list[ type ] ) ) list = this._listeners[ type ] = [];\r
@@ -374,6 +377,8 @@ function X_EventDispatcher_systemListen( that, type, opt_arg1, opt_arg2, opt_arg
        X_EventDispatcher_lock = false;\r
 };\r
 \r
+// TODO this.listen(type) は this リスナの登録なのに、this.unlisten(type)は全てのtypeの削除、と不一致\r
+\r
 /**\r
  * \r
  * @this {X.EventDispatcher}\r