X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F01_core%2F13_XEventDispatcher.js;h=25c2d11477034a160a6fcb231065e418636740b8;hb=dad4215398716c9913e80ec902c76db6762c1dce;hp=bd69138497c55f37e8eff422d974a2f20af2ce7d;hpb=d9cca45398f61025472f2858818519562a746e61;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/01_core/13_XEventDispatcher.js b/0.6.x/js/01_core/13_XEventDispatcher.js index bd69138..25c2d11 100644 --- a/0.6.x/js/01_core/13_XEventDispatcher.js +++ b/0.6.x/js/01_core/13_XEventDispatcher.js @@ -1,4 +1,8 @@ /** + * + */ + +/** * X.EventDispatcher * * 1. as3 ã® EventDispatcher ã©ã¤ã¯ãªã¯ã©ã¹ããã®ã¾ã¾ä½¿ã£ãããç¶æ¿ããããã³ã¼ã«ããã¯ä¸ã«ã¤ãã³ãã追å ãããï¼åé¤ãããï¼ã«ã対å¦ãã¦ããã @@ -32,31 +36,34 @@ var X_EventDispatcher_once = false, // ------------------------------------------------------------------------- // /** - * ã¤ãã³ãã¿ã¼ã²ãã(widnow, document, Image, XHR, Silverlight ç)ãã©ããããå ´åãé常ã¯ãnew æã«æ¸¡ãã¾ããåç §:ã³ã³ã¹ãã©ã¯ã¿å®ä½ {@link X.EventDispatcher.Constructor} - * ã¢ããªã±ã¼ã·ã§ã³ç¬èªã®ã¤ãã³ããããåããããã ããã¨ããå ´åãã¤ãã³ãã¿ã¼ã²ããã¯ä¸è¦ã§ãã + *
ã¤ãã³ãã¿ã¼ã²ãã(widnow, document, Image, XHR, Silverlight ç)ãã©ããããå ´åãé常㯠new æã«æ¸¡ãã¾ãã + *
åç §:ã³ã³ã¹ãã©ã¯ã¿å®ä½ {@link X.EventDispatcher.Constructor} + *
ã¢ããªã±ã¼ã·ã§ã³ç¬èªã®ã¤ãã³ããããåãããããã¨ããå ´åãã¤ãã³ãã¿ã¼ã²ããã¯ä¸è¦ã§ãã + * * @class * @classdesc EventTarget ãªãã¸ã§ã¯ããã©ããããããã¢ããªã±ã¼ã·ã§ã³ã§ç¬èªã«å®ç¾©ããã¤ãã³ããçºä¿¡ããããã®ã¯ã©ã¹ã§ãã - * listen, unlisten, dispatch ã¨ãã addEventListener, removeEventListener, dispatchEvent ã«å¯¾å¿ããé¢æ°ãæã¡ã¾ãã - * ããã« listening ã¨ãããas3 ã® hasEventListener ã«ç¸å½ããé¢æ°ãæã¡ã¾ãã - * ã¤ãã³ãã¿ã¼ã²ãããªãã¸ã§ã¯ã(widnow, document, HTMLElement, XHR ç)ã _rawObject ã«è¨å®ããã¦ããå ´åã«ããããã¸å®éã®ã¤ãã³ãç»é²ã»è§£é¤ãè¡ãã¾ãã - * ãã®ã¤ãã³ãã®ç»é²ã»è§£é¤ã¯ã¯ãã¹ãã©ã¦ã¶ã§ãIE5ï½8 ã®ç¬èªã¤ãã³ãã®å·®ç°ãå¸åããDOM0 ã«å¯¾ãã¦ãè¤æ°ã®ã³ã¼ã«ããã¯ãç»é²ãããã¨ãã§ãã¾ãã - * ã¾ãã³ã¼ã«ããã¯ã«å¯¾ãã¦ãthis ã³ã³ããã¹ããã追å ã®å¼æ°ãæå®ãã§ãã¾ãã this ã³ã³ããã¹ããæå®ããªãã£ãå ´åãEventDispatcher ã¤ã³ã¹ã¿ã³ã¹ãã³ã¼ã«ããã¯ã® this ã«ãªãã¾ãã - * unlisten() ã¯ãå¼æ°ãæå®ããªãã£ãå ´åãå ¨ã¦ã®ã¤ãã³ãã解é¤ãã¾ãããã ããsystemListen çµç±ã§ç»é²ããããã³ãã©ã¯è§£é¤ããã¾ããã + *
listen, unlisten, dispatch ã¨ãã addEventListener, removeEventListener, dispatchEvent ã«å¯¾å¿ããé¢æ°ãæã¡ã¾ãã + *
ã¾ã listening ã¨ãã ActionScript3 ã® hasEventListener ã«ç¸å½ããé¢æ°ãæã¡ã¾ãã + *
ã¤ãã³ãã¿ã¼ã²ãããªãã¸ã§ã¯ã(widnow, document, HTMLElement, XHR ç)ã this._rawObject ã«è¨å®ããã¦ããå ´åã«ããããã¸å®éã®ã¤ãã³ãç»é²ã»è§£é¤ãè¡ãã¾ãã + *
ãã®ã¤ãã³ãã®ç»é²ã»è§£é¤ã¯ã¯ãã¹ãã©ã¦ã¶ã§ãIE5ï½8 ã®ç¬èªã¤ãã³ãã®å·®ç°ãå¸åããDOM0 ã«å¯¾ãã¦ãè¤æ°ã®ã³ã¼ã«ããã¯ãç»é²ãããã¨ãã§ãã¾ãã + *
ã¾ãã³ã¼ã«ããã¯ã«å¯¾ãã¦ãthis ã³ã³ããã¹ããã追å ã®å¼æ°ãæå®ãã§ãã¾ãã this ã³ã³ããã¹ããæå®ããªãã£ãå ´åãEventDispatcher ã¤ã³ã¹ã¿ã³ã¹ãã³ã¼ã«ããã¯ã® this ã«ãªãã¾ãã + *
unlisten() ã¯ãå¼æ°ãæå®ããªãã£ãå ´åãå ¨ã¦ã®ã¤ãã³ãã解é¤ãã¾ãããã ããsystemListen çµç±ã§ç»é²ããããã³ãã©ã¯è§£é¤ããã¾ããã * systemListen, systemUnlisten ã¯ãã©ã¤ãã©ãªå ã®ã³ã¼ãããããã¢ã¯ã»ã¹ã§ãã¾ããã - * @param {object=} opt_rawObject + * + * @augments X_Class_CommonProps + * + * @param {object=} opt_rawObject ã¤ãã³ãã¿ã¼ã²ãã(EventTarget) */ X.EventDispatcher = X.Class.create( 'EventDispatcher', - /** @lends {X.EventDispatcher.prototype} */ + /** @lends X.EventDispatcher.prototype */ { - /** - * @namespace - * @memberof X.EventDispatcher - */ + + // TODO _rawObjectType EventTarget, XHR, Silverlight, ... /** * ã¤ãã³ããªã¹ããã¤ãã³ãå(string)ãæ°å¤(1~,ãã¬ã¼ã ã¯ã¼ã¯å ã§å®ç¾©)ããã¼ã¨ããArrayã§è¨æ¶ãã¾ãã * Arrayã«ã¯ã{k:種é¡,x:ã³ã³ããã¹ã(thisObject),f:é¢æ°,s:ãµããªã¡ã³ãããå¼æ°ã®é å} ã¨ããããã·ã¥ãã¾ãã¯é¢æ°ãèãããã¦ãã¾ãã @@ -67,9 +74,9 @@ X.EventDispatcher = /** * _rawObject ã«ã¯ HTMLElement, window, document, XHR ã¨ãã£ãã¤ãã³ãã¿ã¼ã²ãããªãã¸ã§ã¯ããè¨å®ãã¾ãã - * _rawObject ãè¨å®ããã¦ãã㨠on(), off() æã« addEventListener(DOM Level2) ã detachEvent(ie5ï½8), onï½(DOM0) çãæä½ãã¾ãã - * _rawObject ã¯æåã® on() åã«è¨å®ãã¦ãããªã㨠addEventListener çãæå³ããããã«è¡ããã¾ããã - * X.Node ã§ã¯éåæã« HTMLElement ãçæãã¦ãã¦ãè¦ç´ çæ以åã« on, off ãå¼ã³åºããã¨ãã§ãã¾ããããã¯é©å®ã« migrateEvent, restoreEvent ãå¼ãã§è§£æ±ºãã¦ããããã§ãã + * _rawObject ãè¨å®ããã¦ãã㨠listen(), unlisten() æã« addEventListener(DOM Level2) ã detachEvent(ie5ï½8), onï½(DOM0) çãæä½ãã¾ãã + * _rawObject ã¯æåã® listen() åã«è¨å®ãã¦ãããªã㨠addEventListener çãæå³ããããã«è¡ããã¾ããã + * X.Node ã§ã¯éåæã« HTMLElement ãçæãã¦ãã¦ãè¦ç´ çæ以åã« listen, unlisten ãå¼ã³åºããã¨ãã§ãã¾ããããã¯é©å®ã« X_EventDispatcher_toggleAllEvents ãå¼ãã§è§£æ±ºãã¦ããããã§ãã * @private * @type {Object} */ @@ -83,7 +90,7 @@ X.EventDispatcher = */ '_handleEvent' : null, - /* + /** * dispatch ä¸ã« dispatch ãå¼ã°ããéã«ããã®ãã¹ãã®æ·±ããä¿åããã * dispatch() çµäºæã« _dispatching ã 0 ã®å ´åã«ãç¾å¨ã®ã¤ã³ã¹ã¿ã³ã¹ã® dispatch ããã¹ã¦çµãã£ããã¨ã«ãªãã * @private @@ -91,7 +98,7 @@ X.EventDispatcher = */ '_dispatching' : 0, // dispatch ä¸ã® unlisten ã§ä½¿ç¨ - /* + /** * dispatch ä¸ã« listen ãå¼ã°ããå ´åã«ãé åã®indexãããããã¨ãé¿ãããããä¸æ¦ä¿æããã * _dispatching ã 0 ã®ã¨ãã« _reserves ã使ã£ã¦ listen() ãå¼ã³åºãã * @private @@ -99,7 +106,7 @@ X.EventDispatcher = */ '_reserves' : null, - /* + /** * dispatch ä¸ã« unlisten ãå¼ã°ããå ´åã«ãé åã®indexãããããã¨ãé¿ãããããä¸æ¦ä¿æããã * _dispatching ã 0 ã®ã¨ãã« _unlistens ã使ã£ã¦ unlisten() ãå¼ã³åºãã * @private @@ -107,18 +114,26 @@ X.EventDispatcher = */ '_unlistens' : null, - /* + /** * dispatch ä¸ã« kill ãå¼ã°ããå ´åã«ãX.EventDispatcher ã¤ã³ã¹ã¿ã³ã¹ã®åé¤ã dispatch å¾ã«ãããããã«ç«ã¦ããã©ã°ã * @private * @type {boolean} */ '_killReserved' : false, + + /** + * asyncDispatch ä¸ã« kill ãå¼ã°ããå ´åã«ãX.EventDispatcher ã¤ã³ã¹ã¿ã³ã¹ã®åé¤ãæå¾ã®ã¿ã¤ãã¼ã®çºç«å¾ã«ãããããã«ç«ã¦ããã©ã°ã + * TODO asyncDispatch ã®è§£é¤ã¯ã©ããã? + * @private + * @type {boolean} + */ + '_lastLazyID' : false, /** * X.EventDispatcher ã®ã³ã³ã¹ãã©ã¯ã¿ã®å®ä½ã - *ã@constructs + * @@@constructs * @this {X.EventDispatcher} - * @params {object=} opt_rawObject + * @param {object=} opt_rawObject */ Constructor : function( opt_rawObject ){ if( opt_rawObject ){ @@ -133,12 +148,16 @@ X.EventDispatcher = * @param {(eventHash|string|number)} e */ dispatch : X_EventDispatcher_dispatch, - - /** - * - * @this {X.EventDispatcher} - */ - on : X_EventDispatcher_listen, + + /** + * + * @this {X.EventDispatcher} + * @param {(string|number|Array.<(string,number)>)} type + * @param {(listener|function|Array)=} opt_arg1 + * @param {(function|Array=} opt_arg2 + * @param {Array=} opt_arg3 + * @return {X.EventDispatcher} + */ listen : X_EventDispatcher_listen, /** @@ -156,17 +175,19 @@ X.EventDispatcher = X_EventDispatcher_once = false; return this; }, - - off : X_EventDispatcher_unlisten, + unlisten : X_EventDispatcher_unlisten, /** - * ã¤ãã³ããªã¹ãã®ç»é²ç¶æ³ãçå½å¤ã§è¿ããæ»ãå¤ãæ°å¤(index)ã®å ´åãããããããã¯å é¨ã®ã¿ã§ä½¿ç¨ã - * listening() 㨠type ãçç¥ããå ´åãä¸ã¤ã§ãç»é²ãããã° true ãè¿ãã - * listening( type ) 㨠type ã ããä¸ããå ´åããã® type ã«ç»é²ãããã° true ãè¿ãã - * type 㨠ã¤ãã³ããªã¹ãã®çµã¿åãããç»é²ããã¦ãããã調ã¹ãå ´åã¯ãlisten æã® thisObject ã args(Array) ãä¸è´ããã¦æ¸¡ãå¿ è¦ãããã + *
ã¤ãã³ããªã¹ãã®ç»é²ç¶æ³ãçå½å¤ã§è¿ããæ»ãå¤ãæ°å¤(index)ã®å ´åãããããããã¯å é¨ã®ã¿ã§ä½¿ç¨ã + *
this.listening(); ã®ããã« type ãçç¥ããå ´åãä¸ã¤ã§ãç»é²ãããã° true ãè¿ãã + *
this.listening( 'myevent' ); 㨠type ã ããä¸ããå ´åããã® type ã«ç»é²ãããã° true ãè¿ãã + *
type 㨠ã¤ãã³ããªã¹ãã®çµã¿åãããç»é²ããã¦ãããã調ã¹ãå ´åã¯ãlisten æã® thisObject ã args(Array) ãä¸è´ããã¦æ¸¡ãå¿ è¦ãããã + * + * @example * this.listen( [ 'myevent', 'yourevent' ], this, onMyEvent, args = [ 1, 'a' ] ); * this.listening( 'myevent', this, onMyEvent, args ) === true; + * * @this {X.EventDispatcher} * @return {(number|boolean)} * @param {(string|number)=} opt_type @@ -207,17 +228,16 @@ X.EventDispatcher = /** * delay(ããªç§)å¾ã«ã¤ãã³ãã dispatch ãããæ»ãå¤ã¯ uid = X.Timer.add() ã®ã¿ã¤ãã¼ID(æ°å¤)ãX.Timer.remove(uid) ã§ã¿ã¤ãã¼ã解é¤ã㦠dispatch ãä¸æ¢ã§ããã * @this {X.EventDispatcher} - * @return {number} - * @param {number=} delay ms çç¥ããå ´å㯠0 ã¨ãã¦æ±ã asyncDispatch( 'myevent' ) -> asyncDispatch( 0, 'myevent' ) - * @param {(eventHash|string|number)=} e + * @param {(number|eventHash|string)=} delay ms çç¥ããå ´å㯠0 ã¨ãã¦æ±ã asyncDispatch( 'myevent' ) -> asyncDispatch( 0, 'myevent' ) + * @param {(eventHash|string|number)=} e ã¤ãã³ãã表ãæ°å¤ãæååã{ type : XXX, ... } ãªãªãã¸ã§ã¯ã + * @return {number} X.Timer.add() ã®æ»ãå¤ */ asyncDispatch : function( delay, e ){ if( delay && e === undefined ){ e = delay; delay = 0; - console.log( 'lazy : ' + e ); }; - return X.Timer.add( delay, 1, this, this.dispatch, [ e ] ); + return this[ '_lastLazyID' ] = X.Timer.add( delay, 1, this, X_EventDispatcher_dispatch, [ e ] ); } } ); @@ -285,6 +305,11 @@ function X_EventDispatcher_dispatch( e ){ }; if( ( --this._dispatching ) === 0 ){ + + if( this[ '_lastLazyID' ] && X_Timer_currentUID === this[ '_lastLazyID' ] ){ + delete this[ '_lastLazyID' ]; + }; + // dispatch ä¸ã« unlisten ãããè¦ç´ ã®åé¤ unlistens = this._unlistens; delete this._dispatching; @@ -292,6 +317,7 @@ function X_EventDispatcher_dispatch( e ){ // _unlistens ã«å ¥ã£ã¦ãã callbackHash ã¯ãlock ãã¯ãªã¢ãã¦ãã X_EventDispatcher_unlock = true; for( type in unlistens ){ + //if( X_EMPTY_OBJECT[ type ] ) continue; list = unlistens[ type ]; for( i = list.length; i; ){ this.unlisten( type, list[ --i ] ); @@ -325,15 +351,18 @@ function X_EventDispatcher_dispatch( e ){ /** * * @this {X.EventDispatcher} - * @return {X.EventDispatcher} + * @memberOf X.EventDispatcher.prototype * @param {(string|number|Array.<(string,number)>)} type * @param {(listener|function|Array)=} opt_arg1 * @param {(function|Array=} opt_arg2 * @param {Array=} opt_arg3 + * @return {X.EventDispatcher} */ function X_EventDispatcher_listen( type, opt_arg1, opt_arg2, opt_arg3 ){ var list = this._listeners, i, raw, add, f; + + if( !type ) return this; if( this._dispatching ){ if( !this._reserves ) this._reserves = []; @@ -351,7 +380,7 @@ function X_EventDispatcher_listen( type, opt_arg1, opt_arg2, opt_arg3 ){ raw = this._rawObject || X_UA_DOM.IE4 && X_Node__ie4getRawNode( this ); add = raw && ( !list || !list[ type ] ) && X.Type.isString( type ); - if( this.listening( type, opt_arg1, opt_arg2, opt_arg3 ) ) return this; + if( this.listening( type, opt_arg1 || this, opt_arg2, opt_arg3 ) ) return this; if( !list ) list = this._listeners = {}; if( !( list = list[ type ] ) ) list = this._listeners[ type ] = []; @@ -375,6 +404,8 @@ function X_EventDispatcher_systemListen( that, type, opt_arg1, opt_arg2, opt_arg X_EventDispatcher_lock = false; }; +// TODO this.listen(type) 㯠this ãªã¹ãã®ç»é²ãªã®ã«ãthis.unlisten(type)ã¯å ¨ã¦ã®typeã®åé¤ãã¨ä¸ä¸è´ + /** * * @this {X.EventDispatcher} @@ -402,6 +433,7 @@ function X_EventDispatcher_unlisten( opt_type, opt_arg1, opt_arg2, opt_arg3 ){ if( opt_type === undefined ){ // å ¨ã¦åé¤ for( opt_type in list ){ + //if( X_EMPTY_OBJECT[ opt_type ] ) continue; _list = list[ opt_type ]; for( i = _list.length; i; ){ this.unlisten( opt_type, _list[ --i ] ); // override ããã¦ãããã¨ãããã®ã§ãå¿ ã unlisten ãä½¿ç¨ @@ -472,7 +504,7 @@ function X_EventDispatcher_addEvent( that, type, raw, list ){ if( X.Type.isArray( type ) ){ for( i = type.length; i; ){ X_EventDispatcher_systemListen( that, type[ --i ], X.emptyFunction ); - console.log( 'X_EventDispatcher_systemListen ' + type[ i ] ); + console.log( 'events fix > ' + type[ i ] ); }; } else { X_EventDispatcher_actualAddEvent( that, type, raw, list ); @@ -483,16 +515,26 @@ var X_EventDispatcher_actualAddEvent = // Days on the Moon DOM Events ã¨ãã©ã¦ã¶ã®å®è£ // http://nanto.asablo.jp/blog/2007/03/23/1339502 // Safari 2 ã§ã¯é¢æ°ãªãã¸ã§ã¯ããã EventListener ã¨ãã¦ä½¿ãã¾ããããSafari ã®ãã¤ããªã¼ãã«ãã§ã¯ handleEvent ã¡ã½ãããæã¤ãªãã¸ã§ã¯ãã EventListener ã¨ãã¦ä½¿ããããã§ãã - X_UA_EVENT.W3C /* && ( X.UA.WebKit < 525.13 || X.UA.Opera7 || X.UA.NetFront < 4 ) */ ? // Safari3- + X_UA_EVENT.W3C /* && ( X_UA.WebKit < 525.13 || X_UA.Opera7 || X_UA.NetFront < 4 ) */ ? // Safari3- (function( that, type, raw, list ){ - if( that._isXHR && X.UA.Opera < 12 ){ + if( that._isXHR && X_UA.Opera < 12 ){ // Opera11- ã® XHR 㯠event ãªãã¸ã§ã¯ããè¿ããªããã, eventType æ¯ã« callback ãæå®ãã addEventListener ããªã raw[ 'on' + type ] = X_Callback_create( that, X_EventDispatcher_dispatch, [ type ] ); } else if( that._isSilverlight ){ list.slcallback = X_Callback_create( that, X_EventDispatcher_sliverLightDispatch, [ type ] ); list.sltoken = raw.AddEventListener( type, list.slcallback ); - } else { + } else + // iOS 㨠MacOSX Iron36 ã§çºçãé£ç¶ãã¦ã¢ãã¡ã¼ã·ã§ã³ãèµ·ããã¨ãã¯ãã¼ã¸ã£ã®æç¸ããã obj ã¸ã®ã¢ã¯ã»ã¹ã«å¤±æãããWin ã§ã¯èµ·ããªã? + // ããããMacOSX ã®ãã©ã¦ã¶å ¨è¬ã§èµ·ãã?? + if( ( X_UA.WebKit || X_UA.Blink ) && + ( type === 'webkitTransitionEnd' || type === 'transitionend' || + type === 'animationend' || type === 'webkitAnimationEnd' || + type === 'animationstart' || type === 'webkitAnimationStart' || + type === 'animationiteration' || type === 'webkitAnimationIteration' ) ){ + raw.addEventListener( type, X_EventDispatcher_iOSTransitionEndDispatch, false ); + } else { + console.log( 'event > ' + type ); that._handleEvent || ( that._handleEvent = X_Callback_create( that, X_EventDispatcher_actualHandleEvent ) ); if( raw.addEventListener ){ @@ -537,6 +579,16 @@ var X_EventDispatcher_actualAddEvent = }); /* + * iOS ã® webkitTransitionEnd ãé£ç¶ãã¦èµ·ããå ´åã + * ã³ã¼ã«ããã¯ã®(that._handleEvent)ã¯ãã¼ã¸ã£å ã®å®éã®ã³ã¼ã«ããã¯(X_Callback_actualClosure:obj._)ã + * åç §ã§ãã¦ããªãåé¡ã«ééãããiOS3.1.3 & iOS6.1.5 ã§ç¢ºèª + * animation ãæªããããã + */ +function X_EventDispatcher_iOSTransitionEndDispatch( e ){ + return X_Node_getXNode( this ).dispatch( X_Event_RenameTo[ e.type ] || e.type ); +}; + +/* * Silverlight ã®ã¤ãã³ãã®æ¦è¦ * http://msdn.microsoft.com/ja-jp/library/cc189018%28v=vs.95%29.aspx#the_sender_parameter_and_event_data */ @@ -558,9 +610,9 @@ function X_EventDispatcher_removeEvent( that, type, raw, list, skip ){ }; var X_EventDispatcher_actualRemoveEvent = - X_UA_EVENT.W3C /*&& ( X.UA.WebKit < 525.13 || X.UA.Opera7 || X.UA.NetFront < 4 )*/ ? // Safari3- + X_UA_EVENT.W3C /*&& ( X_UA.WebKit < 525.13 || X_UA.Opera7 || X_UA.NetFront < 4 )*/ ? // Safari3- (function( that, type, raw, list, skip ){ - if( that._isXHR && X.UA.Opera < 12 ){ + if( that._isXHR && X_UA.Opera < 12 ){ X_Callback_correct( raw[ 'on' + type ] ); raw[ 'on' + type ] = ''; } else @@ -569,7 +621,15 @@ var X_EventDispatcher_actualRemoveEvent = X_Callback_correct( list.slcallback ); delete list.sltoken; delete list.slcallback; + } else + if( ( X_UA.WebKit || X_UA.Blink ) && + ( type === 'webkitTransitionEnd' || type === 'transitionend' || + type === 'animationend' || type === 'webkitAnimationEnd' || + type === 'animationstart' || type === 'webkitAnimationStart' || + type === 'animationiteration' || type === 'webkitAnimationIteration' ) ){ + raw.removeEventListener( type, X_EventDispatcher_iOSTransitionEndDispatch, false ); } else { + if( raw.addEventListener ){ raw.removeEventListener( type, that._handleEvent, false ); } else { @@ -657,7 +717,7 @@ var X_EventDispatcher_actualHandleEvent = var ev = new X.Dom.Event( e, this ), ret = X_Callback_NONE, i, l; - console.log( '>>>>>>>>>> ' + e.type ); + //console.log( '>>>>>>>>>> ' + e.type ); // touch event -> pointer if( X.Type.isArray( ev ) ){ if( ev.length === 0 ){ @@ -679,7 +739,7 @@ var X_EventDispatcher_actualHandleEvent = if( ret & X.Callback.PREVENT_DEFAULT ){ this._tag === 'A' && this._rawObject.blur(); e.preventDefault(); - if( X.UA.WebKit < 525.13 ){ // Safari3- + if( X_UA.WebKit < 525.13 ){ // Safari3- if( e.type === 'click' || e.type === 'dbclick' ){ X_EventDispatcher_safariPreventDefault = true; }; @@ -688,7 +748,7 @@ var X_EventDispatcher_actualHandleEvent = }; }); -if( X.UA.WebKit < 525.13 ){ // Safari3- +if( X_UA.WebKit < 525.13 ){ // Safari3- document.documentElement.onclick = document.documentElement.ondbclick = function( e ){ if( X_EventDispatcher_safariPreventDefault ){ @@ -708,6 +768,7 @@ function X_EventDispatcher_toggleAllEvents( that, add ){ type; if( !list || !raw ) return; for( type in list ){ + //if( X_EMPTY_OBJECT[ type ] ) continue; // æ°åã¤ãã³ãã®é¤å¤ if( '' + parseFloat( type ) !== type ){ // TODO type rename ã¯ãã