mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
89198 - add option to show comments column in autocomplete, r=blake, sr=ben
This commit is contained in:
parent
c267683d88
commit
25d2b27b07
@ -162,6 +162,7 @@ Contributor(s): ______________________________________. -->
|
||||
type="autocomplete" searchSessions="history"
|
||||
timeout="50" maxrows="6" alwaysOpenPopup="true"
|
||||
defaultSearchEngine="true" tabScrolling="true"
|
||||
showCommentColumn="true"
|
||||
tooltip="aTooltip" tooltiptext="&locationBar.tooltip;"
|
||||
ontextcommand="return handleURLBarCommand(userAction);"
|
||||
ontextrevert="return handleURLBarRevert();"
|
||||
|
@ -127,9 +127,6 @@
|
||||
|
||||
<property name="mInputListener"><![CDATA[
|
||||
(function(aEvent) {
|
||||
this.resultsPopup.mSearchBox.searchValue = this.currentSearchString;
|
||||
return;
|
||||
|
||||
// "this" is the textbox, not the popup
|
||||
if (this.mSearchInputTO)
|
||||
window.clearTimeout(this.mSearchInputTO);
|
||||
@ -139,21 +136,13 @@
|
||||
|
||||
<property name="mInputTimeout"><![CDATA[
|
||||
(function(me) {
|
||||
me.resultsPopup.mSearchBox.searchValue = me.currentSearchString;
|
||||
me.resultsPopup.mSearchBox.searchValue = me.value;
|
||||
me.mSearchInputTO = 0;
|
||||
});
|
||||
]]></property>
|
||||
|
||||
<property name="mEnginesReady">false</property>
|
||||
|
||||
<!-- initialize the columns in the outliner -->
|
||||
<method name="initColumns">
|
||||
<body><![CDATA[
|
||||
this.addColumn({id: "value", flex: 2});
|
||||
this.addColumn({id: "comment", flex: 1});
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="getOverrideValue">
|
||||
<body><![CDATA[
|
||||
if (this.mSearchBox.selectedIndex != null)
|
||||
|
@ -154,6 +154,12 @@
|
||||
onset="return this.setAttribute('autoFillAfterMatch', val);"
|
||||
onget="return this.getAttribute('autoFillAfterMatch') == 'true';"/>
|
||||
|
||||
<!-- adds a second column to the results list which contains the string
|
||||
in the comment field of each autocomplete result -->
|
||||
<property name="showCommentColumn"
|
||||
onset="return this.setAttribute('showCommentColumn', val);"
|
||||
onget="return this.getAttribute('showCommentColumn') == 'true';"/>
|
||||
|
||||
<!-- option for completing to the default result whenever the user hits
|
||||
enter or the textbox loses focus -->
|
||||
<property name="forceComplete"
|
||||
@ -808,7 +814,9 @@
|
||||
if (!aSessionName || aSessionName != this.getDefaultSession())
|
||||
return;
|
||||
|
||||
if (!this.mFinishAfterSearch && this.autoFill && this.mLastKeyCode != 8) {
|
||||
if (!this.mFinishAfterSearch && this.autoFill &&
|
||||
this.mLastKeyCode != KeyEvent.DOM_VK_BACK_SPACE &&
|
||||
this.mLastKeyCode != KeyEvent.DOM_VK_DELETE) {
|
||||
if (aResults.defaultItemIndex != -1) {
|
||||
var resultValue = this.getSessionValueAt(aSessionName, aResults.defaultItemIndex);
|
||||
var match = resultValue.toLowerCase();
|
||||
@ -1154,7 +1162,11 @@
|
||||
<!-- initialize the columns in the outliner -->
|
||||
<method name="initColumns">
|
||||
<body><![CDATA[
|
||||
this.addColumn({id: "value", flex: 1});
|
||||
if (this.textbox.showCommentColumn) {
|
||||
this.addColumn({id: "value", flex: 2});
|
||||
this.addColumn({id: "comment", flex: 1});
|
||||
} else
|
||||
this.addColumn({id: "value", flex: 1});
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user