rem: var theNum = null; if (active) {  theNum = document.createElement('b');  label.className = 'bufferlabelactive';  label.onclick = null;  label.title = null; } else {  theNum = document.createElement('a'); theNum.setAttribute('href', '#');  label.className = 'bufferlabel';  Event.observe(label, "click", function() { this.activate(n) } .bindAsEventListener(this));  label.title = "Click to activate this query buffer."; } 
add: var theNum = this.setLabelNumber(n, label, active); 
context:     this.setLabel = function(n, active) {        debug.print("QueryBufferListClass.setLabel: " + n + ", " + active);        n = (null == n) ? this.pos : n;        active = active || false;        var label = this.getLabel(n);        // update the active status        var theNum = null;        if (active) {            // show the current index in bold, with no link            theNum = document.createElement('b');            // use highlighting            label.className = 'bufferlabelactive';            // deactivate any onclick            label.onclick = null;            // set tooltip            label.title = null;        } else {            // provide a link to load the buffer            theNum = document.createElement('a');            theNum.setAttribute('href', '#');            // inactive class            label.className = 'bufferlabel';            // make the whole node active            Event.observe(label, "click",                          function() { this.activate(n) }                          .bindAsEventListener(this));            // set tooltip            label.title = "Click to activate this query buffer.";        }        // sometimes 1 + "1" = "11"        theNum.appendChild(document.createTextNode((1 + Number(n)) + "."));        label.appendChild(theNum);        // Update the label text from the query        // ...make sure it doesn't break for huge strings        var query = this.getQuery(n);        query = query.substr(0, 1024);        // ...let the css handle text that's too large for the buffer        // ...we shouldn't have to normalize spaces, but IE6 is broken        // ...and so we have to hint word-breaks to both browsers.        query = nudge(query);        // put a nbsp here for formatting, so it won't be inside the link        label.appendChild(document.createTextNode("\u00a0" + query));        // TODO mouseover for fully formatted text contents as tooltip?    }
meta: 952	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/952/d247a1b6dacb7417d1b16dd5d23f8786e47c143b/query.js/buggy/query.js