rem: gSearchTermList.appendChild(searchrow); 
add: var editFilter = null; try { editFilter = gFilter; } catch(e) { }  var editMailView = null; try { editMailView = gMailView; } catch(e) { }  if ((!editFilter && !editMailView) || (editFilter && index == gTotalSearchTerms) || (editMailView && index == gTotalSearchTerms)) gLoading = false;    if (gLoading || index == gTotalSearchTerms) { gSearchTermList.appendChild(searchrow); } else { var currentItem = gSearchTermList.getItemAtIndex(index); resetIdsMore(index); gSearchTermList.insertBefore(searchrow, currentItem); } 
context: function createSearchRow(index, scope, searchTerm){    var searchAttr = document.createElement("searchattribute");    var searchOp = document.createElement("searchoperator");    var searchVal = document.createElement("searchvalue");    var enclosingBox = document.createElement('vbox');    var boolOp = document.createElement('label');    enclosingBox.setAttribute('align', 'right');    // now set up ids:    searchAttr.id = "searchAttr" + index;    searchOp.id  = "searchOp" + index;    searchVal.id = "searchVal" + index;    boolOp.id = "boolOp" + index;    if (index == 0)      boolOp.setAttribute('value', gBooleanInitialText);    else if (gSearchBooleanRadiogroup.value == 'and')      boolOp.setAttribute('value', gBooleanAndText);    else      boolOp.setAttribute('value', gBooleanOrText);    enclosingBox.appendChild(boolOp);    searchAttr.setAttribute("for", searchOp.id + "," + searchVal.id);    searchOp.setAttribute("opfor", searchVal.id);    var rowdata = new Array(enclosingBox, searchAttr,                            null, searchOp,                            null, searchVal,                            null);    var searchrow = constructRow(rowdata);    searchrow.id = "searchRow" + index;    var searchTermObj = new searchTermContainer;    gSearchTerms[gSearchTerms.length] = {obj:searchTermObj, scope:scope, searchTerm:searchTerm, initialized:false};    searchTermObj.searchattribute = searchAttr;    searchTermObj.searchoperator = searchOp;    searchTermObj.searchvalue = searchVal;    // now invalidate the newly created items because they've been inserted    // into the document, and XBL bindings will be inserted in their place    //searchAttr = searchOp = searchVal = undefined;    // and/or string handling:    // this is scary - basically we want to take every other    // listcell, (note the i+=2) which will be a text label,    // and set the searchTermObj's    // booleanNodes to that    var stringNodes = new Array;    var listcells = searchrow.childNodes;    var j=0;    for (var i=0; i<listcells.length; i+=2) {      stringNodes[j++] = listcells[i];      // see bug #183994 for why these cells are hidden      listcells[i].hidden = true;    }    searchTermObj.booleanNodes = stringNodes;    gSearchTermList.appendChild(searchrow);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/28c16aa5256a9c88c9227e8da77ab588815fa0d9/searchTermOverlay.js/buggy/mailnews/base/search/resources/content/searchTermOverlay.js