OSDN Git Service

Version 0.6.82, X.Timer.remove() work well while onTimeout.
[pettanr/clientJs.git] / 0.6.x / js / 01_dom / 14_XDomAttr.js
index 840bfa7..3fd0ed2 100644 (file)
@@ -136,9 +136,9 @@ X.Dom.Node.prototype.attr = function( nameOrObj /* v */ ){
                                if( X.Dom.Attr.HAS_VALUE[ this._tag ] ){\r
                                        if( this._newAttrs && X.inObject( nameOrObj, this._newAttrs ) ) return this._newAttrs[ nameOrObj ];\r
                                        if( elm = X.Dom.DOM_IE4 ? this._rawObject || this._ie4getRawNode() : this._rawObject ){\r
-                                               attrs[ nameOrObj ] = elm[ nameOrObj ]; // getAttribute( nameOrObj )?\r
+                                               if( !attrs ) attrs = this._attrs = {};\r
+                                               return attrs[ nameOrObj ] = elm[ nameOrObj ]; // getAttribute( nameOrObj )?\r
                                        };\r
-                                       return attrs[ nameOrObj ];\r
                                };\r
                                break;\r
                };\r
@@ -167,7 +167,7 @@ X.Dom.Node.prototype._setAttr = function( attrs, newAttrs, name, v ){
                case 'cssText' :\r
                        return this.cssText( v );\r
        };\r
-       \r
+       // debug\r
        if( name.indexOf( 'on' ) === 0 ){\r
                X.Notification.warn( 'xnode.attr("' + name + '") is wrong, xnode.listen() & xnode.unlisten().' );\r
                return;\r