Changeset 14556

Show
Ignore:
Timestamp:
07/22/08 11:25:37 (6 months ago)
Author:
bill
Message:

Add/fix comments, and simplify one block of code. Refs #5417 !strict.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/_Widget.js

    r14550 r14556  
    221221                        delete this._deferredConnects[attr]; // can't be in both attributeMap and _deferredConnects 
    222222                } 
     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 
    223226                for(var attr in this._deferredConnects){ 
    224227                        if(this[attr] !== dijit._connectOnUseEventHandler){ 
     
    284287                this.buildRendering(); 
    285288 
    286                 // Copy attributes listed in attributeMap into the [newly created] DOM for the widget. 
    287                 // The placement of these attributes is according to the property mapping in attributeMap. 
    288                 // Note special handling for 'style' and 'class' attributes which are lists and can 
    289                 // have elements from both old and new structures, and some attributes like "type" 
    290                 // cannot be processed this way as they are not mutable. 
    291289                if(this.domNode){ 
     290                        // Copy attributes listed in attributeMap into the [newly created] DOM for the widget. 
    292291                        for(var attr in this.attributeMap){ 
    293292                                var value = this[attr]; 
     
    296295                                } 
    297296                        } 
    298                         for(var attr in this._deferredConnects){ 
    299                                 var value = this[attr]; 
    300                                 if(value !== dijit._connectOnUseEventHandler){ 
    301                                         this._onConnect(attr); 
    302                                 } 
     297 
     298                        // If the developer has specified a handler as a widget parameter 
     299                        // (ex: new Button({onClick: ...}) 
     300                        // then naturally need to connect from dom node to that handler immediately,  
     301                        for(var attr in this.params){ 
     302                                this._onConnect(attr); 
    303303                        } 
    304304                } 
     
    476476                //              Set native HTML attributes reflected in the widget, 
    477477                //              such as readOnly, disabled, and maxLength in TextBox widgets. 
     478                //              The placement of these attributes is according to the property mapping in attributeMap. 
     479                // 
    478480                //      description: 
    479                 //              In general, a widget's "value" is controlled via setValue()/getValue(),  
     481                //              Note special handling for 'style' and 'class' attributes which are lists and can 
     482                //              have elements from both old and new structures, and some attributes like "type" 
     483                //              cannot be processed this way as they are not mutable. 
     484                // 
     485                //              Also, in general, a widget's "value" is controlled via setValue()/getValue(),  
    480486                //              rather than this method.  The exception is for widgets where the 
    481487                //              end user can't adjust the value, such as Button and CheckBox;