}\r
);\r
Node._body._startUpdate();\r
- img = xnode._ie4getRawNode ? xnode._ie4getRawNode() : xnode._rawNode;\r
+ img = xnode._ie4getRawNode ? xnode._ie4getRawNode() : xnode._rawObject;\r
remove = true;\r
} else {\r
if( XnodeOrImageElemOrSrc.constructor === X.Dom.Node ){\r
xnode = XnodeOrImageElemOrSrc;\r
- img = xnode._ie4getRawNode ? xnode._ie4getRawNode() : xnode._rawNode;\r
+ img = xnode._ie4getRawNode ? xnode._ie4getRawNode() : xnode._rawObject;\r
} else\r
if( X.Type.isHTMLElement( XnodeOrImageElemOrSrc ) ){\r
img = XnodeOrImageElemOrSrc;\r
+ } else\r
+ if( XnodeOrImageElemOrSrc.constructor === X.EventDispatcher && X.Type.isImage( XnodeOrImageElemOrSrc._rawObject ) ){\r
+ xnode = XnodeOrImageElemOrSrc;\r
+ img = xnode._rawObject;\r
} else {\r
return;\r
};\r
abspath : null,\r
delay : null,\r
timeout : 0,\r
+ \r
Constructor : function( abspath, delay, timeout ){\r
var img;\r
- \r
+\r
this.abspath = abspath;\r
this.delay = delay || 100;\r
this.timeout = timeout || 10000;\r
this.xnode =\r
(\r
window[ 'Image' ] ?\r
- X.Dom.Node( img = new Image() ) :\r
+ X.EventDispatcher( img = new Image() ) :\r
X.Dom.Node._systemNode.create( 'img', { src : abspath } )\r
)\r
- .listen( [ 'load', 'error', 'abort', X.Event.SUCCESS, X.Event.ERROR ], this );\r
+ .listen( [ 'load', 'error', 'abort', X.Event.SUCCESS, X.Event.ERROR, X.Event.KILL_INSTANCE ], this );\r
img && ( img.src = abspath );\r
this._detect();\r
},\r
// if( timer ) return; // これがあると safari3.2 で駄目、、、\r
this.finish = true;\r
this.timerID && X.Timer.remove( this.timerID );\r
- if( window.opera && !this.xnode._rawNode.complete ){\r
+ if( window.opera && !this.xnode._rawObject.complete ){\r
this.timerID = this.asyncDispatch( 0, { type : X.Event.ERROR } );\r
return;\r
};\r
- size = X.Dom.Image.getActualDimension( X.UA.IE && X.UA.IE < 9 && window.Image ? this.abspath : this.xnode );\r
+ size = X.Dom.Image.getActualDimension( X.UA.IE < 9 ? this.abspath : this.xnode );\r
this.timerID = this.asyncDispatch( 0, {\r
type : X.Event.SUCCESS,\r
src : this.abspath,\r
delete this.timerID;\r
X.Timer.once( 0, this, this.kill );\r
break;\r
+ case X.Event.KILL_INSTANCE :\r
+ this.timerID && X.Timer.remove( this.timerID );\r
+ this.xnode.destroy && this.xnode.destroy();\r
+ this.unlisten();\r
+ break;\r
};\r
}, \r
_detect : function(){\r
if( this.finish === true ) return;\r
- if( this.xnode._rawNode && this.xnode._rawNode.complete ){\r
+ if( this.xnode._rawObject && this.xnode._rawObject.complete ){\r
this.finish = true;\r
- if( this.xnode._rawNode.width ) return;\r
+ if( this.xnode._rawObject.width ) return;\r
this.timerID = this.asyncDispatch( 0, { type : X.Event.ERROR } );\r
return;\r
};\r
\r
// this.dispacth( { type : X.Event.CANCELED } );\r
this.kill();\r
- },\r
- onKill : function(){\r
- this.timerID && X.Timer.remove( this.timerID );\r
- this.xnode.destroy();\r
- this.unlisten();\r
}\r
}\r
)\r