OSDN Git Service

Version 0.6.87, fix SuperConstructor @ X.Class & force convert to PointerEvent @...
[pettanr/clientJs.git] / 0.6.x / js / 01_dom / 11_XDomNode.js
index 2e19ddf..ff29163 100644 (file)
@@ -181,11 +181,11 @@ Node._getType = function( v ){
        if( !v ) return 0;\r
        if( v === window ) return Node.IS_WINDOW;\r
        if( v === document ) return Node.IS_DOCUMENT;\r
-       if( X.Type.isImage( v ) ) return Node.IS_IMAGE;\r
        if( v.constructor === Node ) return Node.IS_XNODE;\r
        if( v.constructor === X.Dom.NodeList ) return Node.IS_XNODE_LIST;\r
        if( X.Type.isHTMLElement( v ) ) return Node.IS_RAW_HTML;\r
        if( v.nodeType === 3 ) return Node.IS_RAW_TEXT;\r
+       if( X.Type.isImage( v ) ) return Node.IS_IMAGE;\r
        if( typeof v === 'string' ){\r
                return '<' === v.charAt( 0 ) && v.charAt( v.length - 1 ) === '>' ? Node.IS_HTML_STRING : Node.IS_STRING;\r
        };\r
@@ -288,7 +288,9 @@ Node.prototype.create = function( tag, opt_attrs, opt_css ){
        return xnode;\r
 };\r
 Node.prototype.createAt = function( index, tag, opt_attrs, opt_css ){\r
-       // TODO\r
+       var xnode = Node.create( tag, opt_attrs, opt_css );\r
+       this.appendAt( index, xnode );\r
+       return xnode;\r
 };\r
 \r
 /* --------------------------------------\r
@@ -308,7 +310,9 @@ Node.prototype.createText = function( text ){
        return xnode;\r
 };\r
 Node.prototype.createTextAt = function( index, text ){\r
-       // TODO\r
+       var xtext = Node.createText( text );\r
+       this.appendAt( index, xtext );\r
+       return xtext;\r
 };\r
 \r
 /* --------------------------------------\r
@@ -1299,7 +1303,7 @@ Node.prototype._afterActualCreate =
                };\r
                // src の onload があるので先ではないか?\r
                // ie の str から要素を作る場合、srcだけ イベント設定後ではないか?\r
-               X_EventDispatcher_restoreEvent( this );// イベントの復帰\r
+               X_EventDispatcher_toggleAllEvents( this, true );// イベントの復帰\r
        }) :\r
        X.Dom.DOM_IE4 ? (function(){\r
                var xnodes, i;\r
@@ -1317,7 +1321,7 @@ Node.prototype._afterActualCreate =
                        this._ie4getRawNode().style.filter = X.Dom.Style.SPECIAL_FIX( this._css );\r
                };\r
                delete this._dirty;\r
-               X_EventDispatcher_restoreEvent( this );// イベントの復帰\r
+               X_EventDispatcher_toggleAllEvents( this, true );// イベントの復帰\r
        }) :\r
        (function(){});\r
 \r
@@ -1335,7 +1339,7 @@ Node.prototype._actualRemove =
                        };\r
 \r
                        if( !elm ) return;\r
-                       this._xnodeType === 1 && X_EventDispatcher_migrateEvent( this );// イベントの退避\r
+                       this._xnodeType === 1 && X_EventDispatcher_toggleAllEvents( this, false );// イベントの退避\r
                        // elm.parentNode.tagName for ie7\r
                        if( !X.UA.MacIE ){\r
                                !isChild && elm.parentNode && elm.parentNode.tagName && elm.parentNode.removeChild( elm );\r
@@ -1355,7 +1359,7 @@ Node.prototype._actualRemove =
                        };\r
 \r
                        if( !elm ) return;\r
-                       this._xnodeType === 1 && X_EventDispatcher_migrateEvent( this );// イベントの退避\r
+                       this._xnodeType === 1 && X_EventDispatcher_toggleAllEvents( this, false );// イベントの退避\r
                        \r
                        if( X.Dom.Attr.HAS_VALUE[ this._tag ] && ( !this._newAttrs || !X.inObject( 'value', this._newAttrs ) ) ){\r
                                this._attrs.value = elm.value;\r