rem:   if (this.current == 0) { debug.print(label + "displaying buffers");  this.buffersTitle.className = "buffer-tab-active"; this.historyTitle.className = "buffer-tab";  Element.show(buffersNode); Element.hide(historyNode); return; }  debug.print(label + "displaying history");  this.buffersTitle.className = "buffer-tab"; this.historyTitle.className = "buffer-tab-active";  
context:     this.refresh = function(n) {        var label = "BufferTabsClass.refresh: ";        debug.print(label + n + ", " + this.current);        if (isNaN(n)) {            return this.refresh(this.current);        }        this.current = null == n ? 0 : n;        // focus on the textarea        this.buffers.focus();        var buffersNode = this.buffers.labelList;        var historyNode = this.history.node;        // must ensure that buffers are visible for this to work.        Element.show(buffersNode);        Element.hide(historyNode);        var bufferHeight = this.buffers.input.clientHeight;        var bufferOffset = this.buffers.input.offsetTop;        var bufferWidth = buffersNode.clientWidth;        debug.print(label + "buffer width = " + buffersNode.clientWidth);        // must ensure that history is visible for this to work.        Element.hide(buffersNode);        Element.show(historyNode);        var historyOffset = historyNode.offsetTop;        // match the textarea height        var height = bufferHeight + bufferOffset - historyOffset;        debug.print(label + "new height = " + height);        historyNode.style.minHeight = height + "px";        // set the history and buffers to have the same width        // this works with IE6 and gecko        historyNode.style.width = bufferWidth + "px";        debug.print(label + "history width = " + historyNode.clientWidth);        // simple for now: node 0 is buffer list, 1 is history        // TODO move the instruction text too?        if (this.current == 0) {            debug.print(label + "displaying buffers");            // highlight the active tab            this.buffersTitle.className = "buffer-tab-active";            this.historyTitle.className = "buffer-tab";            // hide and show the appropriate list            Element.show(buffersNode);            Element.hide(historyNode);            return;        }        debug.print(label + "displaying history");        // highlight the active tab        this.buffersTitle.className = "buffer-tab";        this.historyTitle.className = "buffer-tab-active";        // hide and show the appropriate list        Element.hide(buffersNode);        Element.show(historyNode);    }
meta: 952	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/952/d247a1b6dacb7417d1b16dd5d23f8786e47c143b/query.js/buggy/query.js