OSDN Git Service

Version 0.6.128, creanup commitUpdate().
[pettanr/clientJs.git] / 0.6.x / js / 05_util / 01_XNinjaIframe.js
index 8a026f0..0973350 100644 (file)
@@ -13,7 +13,7 @@ X.Util.NinjaIframe = X.EventDispatcher.inherits(
                \r
                _iwin        : null,\r
                \r
-               _html        : '',\r
+               _contentHTML : '',\r
                _name        : '',\r
                _ready       : false,\r
                \r
@@ -35,7 +35,7 @@ X.Util.NinjaIframe = X.EventDispatcher.inherits(
                                }\r
                        );\r
                        \r
-                       X.ViewPort.listenOnce( X.Event.AFTER_UPDATE, this );\r
+                       X_ViewPort.listenOnce( X.Event.AFTER_UPDATE, this );\r
                        \r
                        // http://nanto.asablo.jp/blog/2011/12/08/6237308\r
                        // IE 6/7 で文書間通信を実現するための一案\r
@@ -47,35 +47,34 @@ X.Util.NinjaIframe = X.EventDispatcher.inherits(
                                this.xnodeIframe.css( { position : 'absolute' } );\r
                        };\r
                        \r
-                       if( html ) this._html = html;\r
+                       if( html ) this._contentHTML = html;\r
                },\r
                \r
                handleEvent : function( e ){\r
-                       var raw = this.xnodeIframe._rawObject,\r
-                               html, idoc;\r
+                       var raw = this.xnodeIframe._rawObject;\r
                        \r
                        switch( e.type ){\r
                                case X.Event.AFTER_UPDATE :\r
                                        this._iwin = raw.contentWindow || ( raw.contentDocument && raw.contentDocument.parentWindow ) || window.frames[ this._name ];\r
                                        // http://d.hatena.ne.jp/NeoCat/20080921/1221940658\r
                                        // こちらに名前をsetしないとtargetが動作しない\r
-                                       this._iwin.name = this._name;\r
+                                       if( X_UA.IE ) this._iwin.name = this._name;\r
                                        \r
                                        this.xnodeIframe.listen( [ X_UA.IE < 9 ? 'readystatechange' : 'load', 'error' ], this );\r
                                        \r
                                        if( !( X_UA.IE < 9 ) ){\r
-                                               this._html && X_Util_NinjaIframe_writeToIframe( this );\r
+                                               this._contentHTML && X_Util_NinjaIframe_writeToIframe( this );\r
                                                this._ready = true;\r
                                                return;\r
                                        };\r
                                        \r
                                case 'readystatechange' :\r
-                                       if( ( raw.readyState !== 'complete' && raw.readyState !== 'loaded' ) ) return X.Callback.STOP_PROPAGATION;\r
+                                       if( ( raw.readyState !== 'complete' && raw.readyState !== 'loaded' ) ) break;\r
                                        // ie9-\r
                                        if( !this._ready ){\r
-                                               this._html && X_Util_NinjaIframe_writeToIframe( this );\r
+                                               this._contentHTML && X_Util_NinjaIframe_writeToIframe( this );\r
                                                this._ready = true;\r
-                                               return;\r
+                                               break;\r
                                        };\r
                                        // onload\r
                                case 'load' :\r
@@ -90,14 +89,14 @@ X.Util.NinjaIframe = X.EventDispatcher.inherits(
                        return X.Callback.STOP_PROPAGATION;                     \r
                },\r
                \r
-               refresh : function( opt_html ){\r
+               refresh : function( opt_contentHTML ){\r
                        var raw = this.xnodeIframe._rawObject,\r
                                idoc;\r
                                \r
                        this._ready = false;\r
                        \r
                        if( !this._iwin ){\r
-                               this._html = opt_html;\r
+                               this._contentHTML = opt_contentHTML;\r
                                return this;\r
                        };\r
                        \r
@@ -107,9 +106,9 @@ X.Util.NinjaIframe = X.EventDispatcher.inherits(
                                this._iwin.location.reload();\r
                        };\r
                        \r
-                       if( !opt_html ) return this;\r
+                       if( !opt_contentHTML ) return this;\r
                        \r
-                       this._html = opt_html;\r
+                       this._contentHTML = opt_contentHTML;\r
                        X_UA.IE < 9 || X_Util_NinjaIframe_writeToIframe( this );\r
                        \r
                        return this;\r
@@ -127,9 +126,9 @@ X.Util.NinjaIframe = X.EventDispatcher.inherits(
 function X_Util_NinjaIframe_writeToIframe( that ){\r
        var raw  = that.xnodeIframe._rawObject,\r
                idoc = raw.contentDocument || that._iwin.document,\r
-               html = that._html;\r
+               html = that._contentHTML;\r
                \r
-       delete that._html;\r
+       delete that._contentHTML;\r
        that._ready = true;\r
 \r
        idoc.open();\r