window.PointerEvent = window.MSPointerEvent;\r
};\r
} else {\r
- X.Dom.Event = function( e, xnode, element ){\r
+ X.Dom.Event = function( e, xnode, element, opt_type ){\r
var btn;\r
\r
//this._event = e;\r
- this.type = X.Dom.Event.RenameTo[ e.type ] || e.type;\r
+ this.type = X.Dom.Event.RenameTo[ e.type ] || e.type || opt_type;\r
this.target = Node._getXNode( e.srcElement ); // xnode\r
if( this.target && this.target._xnodeType === 3 ) this.target = this.target.parent; // ie4 の fake Textnode がヒットしていないか?\r
this.currentTarget = xnode; // xnode\r
})( X.Dom.Event.Rename, X.Dom.Event.RenameTo );\r
\r
\r
-\r
-// TODO handleEvent を拡張可能にするために、クロージャに移動する\r
-// Is this in regard to the Safari 1.x preventDefault bug on click/dblclick?\r
-// https://groups.google.com/forum/#!msg/comp.lang.javascript/uYEuCHjHxnw/yKoHtZJPa1QJ\r
-X.Dom.Node.prototype.handleEvent =\r
- X.UA.IE4 || X.UA.IE5678 ? // ie45678 EVENT_IE & EVENT_DOM0 for ie4\r
- (function(){\r
- var ret;\r
- \r
- if( event.type === 'readystatechange' && this._tag && X.Dom.Event._LOAD_FIX_TAGS[ this._tag ] ){\r
- //type = 'readystatechange';\r
- };\r
- \r
- ret = X.EventDispatcher.prototype.dispatch.call( this, new X.Dom.Event( event, this, this._rawNode ) );\r
-\r
- if( ret & X.Callback.STOP_PROPAGATION ){\r
- event.cancelBubble = true;\r
- };\r
- if( ret & X.Callback.PREVENT_DEFAULT ){\r
- this._tag === 'A' && this._rawNode.blur();\r
- return event.returnValue = false;\r
- };\r
- }) :\r
- //X.Dom.EVENT_W3C & EVENT_DOM0\r
- (function( e ){\r
- var ret = X.EventDispatcher.prototype.dispatch.call( this, new X.Dom.Event( e, this ) );\r
- \r
- if( ret & X.Callback.STOP_PROPAGATION ){\r
- e.stopPropagation();\r
- };\r
- if( ret & X.Callback.PREVENT_DEFAULT ){\r
- this._tag === 'A' && this._rawNode.blur();\r
- e.preventDefault();\r
- if( X.UA.WebKit < 525.13 ){ // Safari3-\r
- if( e.type === 'click' || e.type === 'dbclick' ){\r
- X.Dom._safariPreventDefault = true;\r
- };\r
- };\r
- return false;\r
- };\r
- });\r
-\r
-\r
-// イベントの退避、dom が画面から抜かれる場合に実施しておく\r
-X.Dom.Node.prototype._migrateEvent = function(){\r
- var hash = this._listeners,\r
- type;\r
- if( !hash ) return;\r
- for( type in hash ){\r
- // 数字イベントの除外\r
- /*'' + parseFloat( type ) !== type && */x_eventdispatcher_actualRemoveEvent( this, type );\r
- };\r
-};\r
-\r
-// 退避したイベントの復帰\r
-X.Dom.Node.prototype._restoreEvent = function(){\r
- var hash = this._listeners,\r
- type;\r
- if( !hash ) return;\r
- for( type in hash ){\r
- // 数字イベントの除外\r
- /*'' + parseFloat( type ) !== type && */ x_eventdispatcher_actualAddEvent( this, type );\r
- };\r
-};\r
-\r
/* -----------------------------------------------\r
* Document Ready\r
* Dean Edwards/Matthias Miller/John Resig\r