From 4e8968aff3bf2dfb8f5e11ad010960f0c95710c4 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 14 Apr 2011 19:16:48 -0700 Subject: [PATCH] Don't send a new query if the keydown doesn't edit the query value, i.e. command-tab or shift. --- .../rsrc/js/application/core/behavior-object-selector.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webroot/rsrc/js/application/core/behavior-object-selector.js b/webroot/rsrc/js/application/core/behavior-object-selector.js index eeebfdbf83..722c2a5b92 100644 --- a/webroot/rsrc/js/application/core/behavior-object-selector.js +++ b/webroot/rsrc/js/application/core/behavior-object-selector.js @@ -20,6 +20,8 @@ JX.behavior('phabricator-object-selector', function(config) { 'input', 'aphront-dialog-application-input'); + var last_value = JX.$(config.query).value; + function onreceive(seq, r) { if (seq != n) { return; @@ -161,6 +163,12 @@ JX.behavior('phabricator-object-selector', function(config) { 'keydown', null, function(e) { + var cur_value = JX.$(config.query).value; + if (last_value == cur_value) { + return; + } + last_value = cur_value; + if (query_timer) { query_timer.stop(); }