From ab3c81039c2f32f082cb5eb62711db6f7a5df68f Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 17 Apr 2017 07:31:44 -0700 Subject: [PATCH] (stable) 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 --- resources/celerity/map.php | 28 +++++++++---------- .../rsrc/js/core/behavior-search-typeahead.js | 5 ++-- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index d9eb3a42e0..fead6aa9dc 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -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', diff --git a/webroot/rsrc/js/core/behavior-search-typeahead.js b/webroot/rsrc/js/core/behavior-search-typeahead.js index 864d45ff29..fc752a6079 100644 --- a/webroot/rsrc/js/core/behavior-search-typeahead.js +++ b/webroot/rsrc/js/core/behavior-search-typeahead.js @@ -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; }