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:
		| @@ -10,7 +10,7 @@ return array( | |||||||
|     'conpherence.pkg.css' => '437d3b5a', |     'conpherence.pkg.css' => '437d3b5a', | ||||||
|     'conpherence.pkg.js' => '281b1a73', |     'conpherence.pkg.js' => '281b1a73', | ||||||
|     'core.pkg.css' => 'b2ad82f4', |     'core.pkg.css' => 'b2ad82f4', | ||||||
|     'core.pkg.js' => 'bf3b5cdf', |     'core.pkg.js' => 'deabcef7', | ||||||
|     'darkconsole.pkg.js' => 'e7393ebb', |     'darkconsole.pkg.js' => 'e7393ebb', | ||||||
|     'differential.pkg.css' => '90b30783', |     'differential.pkg.css' => '90b30783', | ||||||
|     'differential.pkg.js' => 'ddfeb49b', |     'differential.pkg.js' => 'ddfeb49b', | ||||||
| @@ -510,7 +510,7 @@ return array( | |||||||
|     'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e', |     'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e', | ||||||
|     'rsrc/js/core/behavior-reveal-content.js' => '60821bc7', |     'rsrc/js/core/behavior-reveal-content.js' => '60821bc7', | ||||||
|     'rsrc/js/core/behavior-scrollbar.js' => '834a1173', |     '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-content.js' => 'bf5374ef', | ||||||
|     'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6', |     'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6', | ||||||
|     'rsrc/js/core/behavior-setup-check-https.js' => '491416b3', |     'rsrc/js/core/behavior-setup-check-https.js' => '491416b3', | ||||||
| @@ -666,7 +666,7 @@ return array( | |||||||
|     'javelin-behavior-phabricator-oncopy' => '2926fff2', |     'javelin-behavior-phabricator-oncopy' => '2926fff2', | ||||||
|     'javelin-behavior-phabricator-remarkup-assist' => '0ca788bd', |     'javelin-behavior-phabricator-remarkup-assist' => '0ca788bd', | ||||||
|     'javelin-behavior-phabricator-reveal-content' => '60821bc7', |     '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-show-older-transactions' => '94c65b72', | ||||||
|     'javelin-behavior-phabricator-tooltips' => 'c420b0b9', |     'javelin-behavior-phabricator-tooltips' => 'c420b0b9', | ||||||
|     'javelin-behavior-phabricator-transaction-comment-form' => 'b23b49e6', |     'javelin-behavior-phabricator-transaction-comment-form' => 'b23b49e6', | ||||||
| @@ -988,17 +988,6 @@ return array( | |||||||
|       'phuix-autocomplete', |       'phuix-autocomplete', | ||||||
|       'javelin-mask', |       '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( |     '0f764c35' => array( | ||||||
|       'javelin-install', |       'javelin-install', | ||||||
|       'javelin-util', |       'javelin-util', | ||||||
| @@ -2155,6 +2144,17 @@ return array( | |||||||
|       'javelin-dom', |       'javelin-dom', | ||||||
|       'phabricator-draggable-list', |       '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( |     'edf8a145' => array( | ||||||
|       'javelin-behavior', |       'javelin-behavior', | ||||||
|       'javelin-uri', |       'javelin-uri', | ||||||
|   | |||||||
| @@ -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 |     // 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 |     // we show 3 applications, then 3 users, etc. For jump items, we show only | ||||||
|     // one result. |     // one result. | ||||||
|  |  | ||||||
|     var jj; |     var jj; | ||||||
|     var results = []; |     var results = []; | ||||||
|     for (ii = 0; ii < type_order.length; ii++) { |     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 |         //   - we have more items than will fit in the typeahead, and this | ||||||
|         //     is the 4..Nth result of its type. |         //     is the 4..Nth result of its type. | ||||||
|  |  | ||||||
|         var skip = ((current_type == 'jump') && (jj > 1)) || |         var skip = ((current_type == 'jump') && (jj >= 1)) || | ||||||
|                    ((list.length > config.limit) && (type_count > 3)); |                    ((list.length > config.limit) && (jj >= 3)); | ||||||
|         if (skip) { |         if (skip) { | ||||||
|           continue; |           continue; | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 epriestley
					epriestley