Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Replace 'smart autocomplete' with a purpose-built QuickSearchField module #7227

Merged
merged 8 commits into from
Apr 7, 2015
11 changes: 6 additions & 5 deletions src/extensions/default/QuickOpenCSS/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@ define(function (require, exports, module) {
}

/**
* Select the selected item in the current document
* Scroll top the selected item in the current document (unless no query string entered yet,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment doesn't match the current signature anymore.

* in which case the topmost list item is irrelevant)
* @param {?SearchResult} selectedItem
*/
function itemFocus(selectedItem) {
if (!selectedItem) {
function itemFocus(selectedItem, query) {
if (!selectedItem || query.length < 2) {
return;
}
var selectorInfo = selectedItem.selectorInfo;
Expand All @@ -107,8 +108,8 @@ define(function (require, exports, module) {
EditorManager.getCurrentFullEditor().setSelection(from, to, true);
}

function itemSelect(selectedItem) {
itemFocus(selectedItem);
function itemSelect(selectedItem, query) {
itemFocus(selectedItem, query);
}


Expand Down
11 changes: 6 additions & 5 deletions src/extensions/default/QuickOpenHTML/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ define(function (require, exports, module) {


/**
* Select the selected item in the current document
* Scroll top the selected item in the current document (unless no query string entered yet,
* in which case the topmost list item is irrelevant)
* @param {?SearchResult} selectedItem
*/
function itemFocus(selectedItem) {
if (!selectedItem) {
function itemFocus(selectedItem, query) {
if (!selectedItem || query.length < 2) {
return;
}
var fileLocation = selectedItem.fileLocation;
Expand All @@ -141,8 +142,8 @@ define(function (require, exports, module) {
EditorManager.getCurrentFullEditor().setSelection(from, to, true);
}

function itemSelect(selectedItem) {
itemFocus(selectedItem);
function itemSelect(selectedItem, query) {
itemFocus(selectedItem, query);
}


Expand Down
11 changes: 6 additions & 5 deletions src/extensions/default/QuickOpenJavaScript/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ define(function (require, exports, module) {
}

/**
* Select the selected item in the current document
* Scroll top the selected item in the current document (unless no query string entered yet,
* in which case the topmost list item is irrelevant)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentation doesn't match the current function signature

* @param {?SearchResult} selectedItem
*/
function itemFocus(selectedItem) {
if (!selectedItem) {
function itemFocus(selectedItem, query) {
if (!selectedItem || query.length < 2) {
return;
}
var fileLocation = selectedItem.fileLocation;
Expand All @@ -134,8 +135,8 @@ define(function (require, exports, module) {
EditorManager.getCurrentFullEditor().setSelection(from, to, true);
}

function itemSelect(selectedItem) {
itemFocus(selectedItem);
function itemSelect(selectedItem, query) {
itemFocus(selectedItem, query);
}


Expand Down
Loading