Ticket #1958: dojo0.3.1_ContentPaneCssUnloadFix.diff

File dojo0.3.1_ContentPaneCssUnloadFix.diff, 1.3 kB (added by robert.coup@…, 22 months ago)

Fix for ContentPane? styles not being unloaded in 0.3.1

  • src/widget/html/ContentPane.js

    old new  
    130130                this._runStack("_onUnLoadStack"); 
    131131                this.scriptScope = null; 
     132                 
     133                // remove old children from current content 
     134                this.destroyChildren(); 
     135 
     136                // remove old stylenodes from HEAD 
     137                if(this._remoteStyles){ 
     138                        for(var i = 0; i < this._remoteStyles.length; i++){ 
     139                                if(this._remoteStyles[i] && this._remoteStyles[i].parentNode){ 
     140                                        this._remoteStyles[i].parentNode.removeChild(this._remoteStyles[i]); 
     141                                } 
     142                        } 
     143                        this._remoteStyles = null; 
     144                } 
    132145        }, 
    133146 
     
    396409                //              private internal function without path regExpCheck and no onLoad calls aftervards 
    397410 
    398                 // remove old children from current content 
    399                 this.destroyChildren(); 
    400  
    401                 // remove old stylenodes from HEAD 
    402                 if(this._remoteStyles){ 
    403                         for(var i = 0; i < this._remoteStyles.length; i++){ 
    404                                 if(this._remoteStyles[i] && this._remoteStyles.parentNode){ 
    405                                         this._remoteStyles[i].parentNode.removeChild(this._remoteStyles[i]); 
    406                                 } 
    407                         } 
    408                         this._remoteStyles = null; 
    409                 } 
    410  
    411411                var node = this.containerNode || this.domNode; 
    412412                try{