Changeset 12068

Show
Ignore:
Timestamp:
01/17/08 09:50:40 (12 months ago)
Author:
dante
Message:

fixes #5351 - modal connects not being disconnected in a lot of destroy/hide combinations.
accomodates focus state, but simply destroy's the underlay and bgiframe etc.

Location:
dijit/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/Dialog.js

    r12044 r12068  
    149149                        this.connect(this, "onExecute", "hide"); 
    150150                        this.connect(this, "onCancel", "hide"); 
     151                        this._modalconnects = [];        
    151152                }, 
    152153 
     
    162163                        //              time (but we defer it until right beforehand, for 
    163164                        //              performance reasons) 
    164  
    165                         this._modalconnects = []; 
    166165 
    167166                        if(this.titleBar){ 
     
    282281                        // summary: display the dialog 
    283282 
     283                        if(this.open){ return; } 
     284                         
    284285                        // first time we show the dialog, there's some initialization stuff to do                        
    285286                        if(!this._alreadyInitialized){ 
     
    347348                                this._position(); 
    348349                        } 
     350                }, 
     351                 
     352                destroy: function(){ 
     353                        dojo.forEach(this._modalconnects, dojo.disconnect); 
     354                        if(this.open){ 
     355                                var fo = this._savedFocus; 
     356                                setTimeout(dojo.hitch(dijit,"focus",fo),25); 
     357                        } 
     358                        this.inherited(arguments);                       
    349359                } 
    350360        } 
  • dijit/trunk/tests/test_Dialog_focusDestroy.html

    r12065 r12068  
    2828 
    2929                        var input = document.createElement("input"); 
    30                         dojo.attr(input,"tabIndex","1"); 
     30                        dojo.attr(input,"tabIndex","0"); 
    3131                        dlg.containerNode.appendChild(input); 
    3232 
     
    3737                                console.log("destroying, while visible");  
    3838                                dlg.destroy(); 
     39                                 
    3940                        }); 
    4041                        dlg.show();