OSDN Git Service

Version 0.6.70, bugfix.
[pettanr/clientJs.git] / 0.6.x / js / 01_dom / 14_XDomAttr.js
index 77d8600..04a1891 100644 (file)
@@ -118,7 +118,7 @@ X.Dom.Node.prototype.attr = function( nameOrObj /* v */ ){
                // getter\r
                switch( nameOrObj ){\r
                        case 'id' :\r
-                               return this._tag;\r
+                               return this._id;\r
                        case 'class' :\r
                        case 'className' :\r
                                return this._className;\r
@@ -146,18 +146,26 @@ X.Dom.Node.prototype.attr = function( nameOrObj /* v */ ){
        };\r
 };\r
 X.Dom.Node.prototype._setAttr = function( attrs, newAttrs, name, v ){\r
-       if( name === 'UID' ) return;\r
-       if( name === 'id' ){\r
-               v = ( v !== 'ie4uid' + this._uid ) ? v : undefined;\r
-               if( v !== this._id ){\r
-                       this._id = v;\r
-                       this._dirty |= X.Dom.Dirty.ID;\r
-                       this._root && this._reserveUpdate();\r
-               };\r
-               return;\r
-       };      \r
-       if( name === 'class' ) return this.className( v );      \r
-       if( name === 'style' ) return this.cssText( v );\r
+       switch( name ){\r
+               case 'UID' :\r
+               case 'tag' :\r
+               case 'tagName' :\r
+                       return;\r
+               case 'id' :\r
+                       v = ( v !== 'ie4uid' + this._uid ) ? v : undefined;\r
+                       if( v !== this._id ){\r
+                               this._id = v;\r
+                               this._dirty |= X.Dom.Dirty.ID;\r
+                               this._root && this._reserveUpdate();\r
+                       };\r
+                       return; \r
+               case 'class' :\r
+               case 'className' :\r
+                       return this.className( v );\r
+               case 'style' :\r
+               case 'cssText' :\r
+                       return this.cssText( v );\r
+       };\r
        \r
        if( name.indexOf( 'on' ) === 0 ){\r
                X.Notification.warn( 'xnode.attr("' + name + '") is wrong, xnode.listen() & xnode.unlisten().' );\r