Changeset 14557

Show
Ignore:
Timestamp:
07/22/08 11:50:08 (4 months ago)
Author:
bill
Message:

Move code in constructor into create(), where all the other code is.
Refs #5417 !strict.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/_Widget.js

    r14556 r14557  
    214214        postscript: function(/*Object?*/params, /*DomNode|String*/srcNodeRef){ 
    215215                this.create(params, srcNodeRef); 
    216         }, 
    217  
    218         constructor: function(){ 
    219                 this._deferredConnects = dojo.clone(this._deferredConnects); 
    220                 for(var attr in this.attributeMap){ 
    221                         delete this._deferredConnects[attr]; // can't be in both attributeMap and _deferredConnects 
    222                 } 
    223                 // If a subclass has redefined a callback (ex: onClick) then assume it's being 
    224                 // attached to explicitly, via dojoAttachEvent="" (or attributeMap, but that was handled 
    225                 // above) and ignore the entry in _deferredConnects 
    226                 for(var attr in this._deferredConnects){ 
    227                         if(this[attr] !== dijit._connectOnUseEventHandler){ 
    228                                 delete this._deferredConnects[attr]; 
    229                         } 
    230                 } 
    231216        }, 
    232217 
     
    269254                this._attaches = []; 
    270255 
     256                // To avoid double-connects, remove entries from _deferredConnects 
     257                // that have been setup manually by a subclass (ex, by dojoAttachEvent). 
     258                // If a subclass has redefined a callback (ex: onClick) then assume it's being 
     259                // connected to manually. 
     260                this._deferredConnects = dojo.clone(this._deferredConnects); 
     261                for(var attr in this.attributeMap){ 
     262                        delete this._deferredConnects[attr]; // can't be in both attributeMap and _deferredConnects 
     263                } 
     264                for(var attr in this._deferredConnects){ 
     265                        if(this[attr] !== dijit._connectOnUseEventHandler){ 
     266                                delete this._deferredConnects[attr];    // redefined, probably dojoAttachEvent exists 
     267                        } 
     268                } 
     269 
    271270                //mixin our passed parameters 
    272271                if(this.srcNodeRef && (typeof this.srcNodeRef.id == "string")){ this.id = this.srcNodeRef.id; } 
     
    279278                // generate an id for the widget if one wasn't specified 
    280279                // (be sure to do this before buildRendering() because that function might 
    281                 // expect the id to be there. 
     280                // expect the id to be there.) 
    282281                if(!this.id){ 
    283282                        this.id = dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));