diff options
Diffstat (limited to 'search/js')
-rw-r--r-- | search/js/search.js | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/search/js/search.js b/search/js/search.js index b74674d5aa7..87b8908aa0a 100644 --- a/search/js/search.js +++ b/search/js/search.js @@ -276,12 +276,6 @@ currentResult++; renderCurrent(); } - } else if(event.keyCode === 27) { //esc - $searchBox.val(''); - if(self.hasFilter(getCurrentApp())) { - self.getFilter(getCurrentApp())(''); - } - self.hideResults(); } else { var query = $searchBox.val(); if (lastQuery !== query) { @@ -297,6 +291,15 @@ } } }); + $(document).keyup(function(event) { + if(event.keyCode === 27) { //esc + $searchBox.val(''); + if(self.hasFilter(getCurrentApp())) { + self.getFilter(getCurrentApp())(''); + } + self.hideResults(); + } + }); $searchResults.on('click', 'tr.result', function (event) { var $row = $(this); @@ -316,13 +319,6 @@ scrollToResults(); return false; }); - $(document).click(function (event) { - $searchBox.val(''); - if(self.hasFilter(getCurrentApp())) { - self.getFilter(getCurrentApp())(''); - } - self.hideResults(); - }); placeStatus(); OC.Plugins.attach('OCA.Search', this); |