diff --git a/mozilla/xpfe/global/resources/content/bindings/listbox.xml b/mozilla/xpfe/global/resources/content/bindings/listbox.xml index 698a642506a..974c20c42a8 100644 --- a/mozilla/xpfe/global/resources/content/bindings/listbox.xml +++ b/mozilla/xpfe/global/resources/content/bindings/listbox.xml @@ -34,6 +34,8 @@ null null null + 0 + "" + + @@ -635,6 +642,45 @@ this.currentItem.checked = !this.currentItem.checked; ]]> + + 0) { + var key = String.fromCharCode(event.charCode); + key = key.toLowerCase(); + if (event.timeStamp - this._lastKeyTime > 1000) + this._incrementalString = key; + else { + if (this._incrementalString.length != 1 || this._incrementalString.charAt(0) != key.charAt(0)) + this._incrementalString += key; + } + this._lastKeyTime = event.timeStamp; + + var l = this.selectedItems.length; + var c = -1; + if (l > 0) + c = this.getIndexOfItem(this.selectedItems[l-1]); + var rowCount = this.getRowCount(); + var start = 1; + + if (this._incrementalString.length > 1) + start = 0; + + for (var i = 0; i < rowCount; i++) { + var k = (i + start + c) % rowCount; + var item = this.getItemAtIndex(k); //listitem + var cellText = item.getAttribute("label"); + cellText = cellText.toLowerCase(); + if (cellText.search(this._incrementalString) == 0) { + this._isUpSelection=0; + this._isDownSelection=0; + this.ensureIndexIsVisible(k); + this.timedSelect(item, 500); + break; + } + } + } + ]]> +