diff --git a/src/view/control/objectselector/PhabricatorObjectSelectorDialog.php b/src/view/control/objectselector/PhabricatorObjectSelectorDialog.php index a35983caa9..466058bc26 100644 --- a/src/view/control/objectselector/PhabricatorObjectSelectorDialog.php +++ b/src/view/control/objectselector/PhabricatorObjectSelectorDialog.php @@ -101,9 +101,6 @@ class PhabricatorObjectSelectorDialog { - - - '); $result_box = diff --git a/webroot/rsrc/js/application/core/behavior-object-selector.js b/webroot/rsrc/js/application/core/behavior-object-selector.js index 72be21dd7a..eeebfdbf83 100644 --- a/webroot/rsrc/js/application/core/behavior-object-selector.js +++ b/webroot/rsrc/js/application/core/behavior-object-selector.js @@ -12,6 +12,8 @@ JX.behavior('phabricator-object-selector', function(config) { phids[k] = true; } var attach_list = {}; + var query_timer = null; + var query_delay = 50; var phid_input = JX.DOM.find( JX.$(config.form), @@ -94,6 +96,7 @@ JX.behavior('phabricator-object-selector', function(config) { } function sendQuery() { + query_timer = null; JX.DOM.setContent(JX.$(config.results), renderNote('Loading...')) new JX.Request(config.uri, JX.bind(null, onreceive, ++n)) .setData({ @@ -103,24 +106,6 @@ JX.behavior('phabricator-object-selector', function(config) { .send(); } - JX.DOM.listen( - JX.$(config.search), - 'submit', - null, - function(e) { - e.kill(); - sendQuery(); - }); - JX.DOM.listen( - JX.$(config.search), - 'click', - 'tag:button', - function(e) { - e.kill(); - sendQuery(); - }); - - JX.DOM.listen( JX.$(config.results), 'click', @@ -162,6 +147,26 @@ JX.behavior('phabricator-object-selector', function(config) { redrawAttached(); }); + JX.DOM.listen( + JX.$(config.filter), + 'change', + null, + function(e) { + e.kill(); + sendQuery(); + }); + + JX.DOM.listen( + JX.$(config.query), + 'keydown', + null, + function(e) { + if (query_timer) { + query_timer.stop(); + } + query_timer = JX.defer(sendQuery, query_delay); + }); + sendQuery(); redrawAttached();