1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Fix a bad variable in global typehaead order/limit code

Summary: Ref T12538. I missed this in D17695, which renamed the variable. The logic was also a little off since `jj` is an index, not a count.

Test Plan: Typed `con` in global search, which hits "Con-pherence", "Con-duit" and "Con-fig", plus a bunch of other stuff. Got results after patch.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12538

Differential Revision: https://secure.phabricator.com/D17700
This commit is contained in:
epriestley 2017-04-17 07:31:44 -07:00
parent a56f9a1a55
commit b08b4cf0b5
2 changed files with 16 additions and 17 deletions

View file

@ -10,7 +10,7 @@ return array(
'conpherence.pkg.css' => '437d3b5a',
'conpherence.pkg.js' => '281b1a73',
'core.pkg.css' => 'b2ad82f4',
'core.pkg.js' => 'bf3b5cdf',
'core.pkg.js' => 'deabcef7',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '90b30783',
'differential.pkg.js' => 'ddfeb49b',
@ -510,7 +510,7 @@ return array(
'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e',
'rsrc/js/core/behavior-reveal-content.js' => '60821bc7',
'rsrc/js/core/behavior-scrollbar.js' => '834a1173',
'rsrc/js/core/behavior-search-typeahead.js' => '0f2a0820',
'rsrc/js/core/behavior-search-typeahead.js' => 'eded9ee8',
'rsrc/js/core/behavior-select-content.js' => 'bf5374ef',
'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6',
'rsrc/js/core/behavior-setup-check-https.js' => '491416b3',
@ -666,7 +666,7 @@ return array(
'javelin-behavior-phabricator-oncopy' => '2926fff2',
'javelin-behavior-phabricator-remarkup-assist' => '0ca788bd',
'javelin-behavior-phabricator-reveal-content' => '60821bc7',
'javelin-behavior-phabricator-search-typeahead' => '0f2a0820',
'javelin-behavior-phabricator-search-typeahead' => 'eded9ee8',
'javelin-behavior-phabricator-show-older-transactions' => '94c65b72',
'javelin-behavior-phabricator-tooltips' => 'c420b0b9',
'javelin-behavior-phabricator-transaction-comment-form' => 'b23b49e6',
@ -988,17 +988,6 @@ return array(
'phuix-autocomplete',
'javelin-mask',
),
'0f2a0820' => array(
'javelin-behavior',
'javelin-typeahead-ondemand-source',
'javelin-typeahead',
'javelin-dom',
'javelin-uri',
'javelin-util',
'javelin-stratcom',
'phabricator-prefab',
'phuix-icon-view',
),
'0f764c35' => array(
'javelin-install',
'javelin-util',
@ -2155,6 +2144,17 @@ return array(
'javelin-dom',
'phabricator-draggable-list',
),
'eded9ee8' => array(
'javelin-behavior',
'javelin-typeahead-ondemand-source',
'javelin-typeahead',
'javelin-dom',
'javelin-uri',
'javelin-util',
'javelin-stratcom',
'phabricator-prefab',
'phuix-icon-view',
),
'edf8a145' => array(
'javelin-behavior',
'javelin-uri',

View file

@ -94,7 +94,6 @@ JX.behavior('phabricator-search-typeahead', function(config) {
// If we have more results than fit, limit each type of result to 3, so
// we show 3 applications, then 3 users, etc. For jump items, we show only
// one result.
var jj;
var results = [];
for (ii = 0; ii < type_order.length; ii++) {
@ -108,8 +107,8 @@ JX.behavior('phabricator-search-typeahead', function(config) {
// - we have more items than will fit in the typeahead, and this
// is the 4..Nth result of its type.
var skip = ((current_type == 'jump') && (jj > 1)) ||
((list.length > config.limit) && (type_count > 3));
var skip = ((current_type == 'jump') && (jj >= 1)) ||
((list.length > config.limit) && (jj >= 3));
if (skip) {
continue;
}