From 03e34cc3000bef7119a7b4a36a8e3d84daa33931 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 27 Nov 2012 18:02:42 +0100 Subject: [PATCH] Closing search overlay after a short delay Fixes #888 --- wcfsetup/install/files/js/WCF.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 8a00d29e68..420cf75876 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -4513,6 +4513,22 @@ WCF.Search.Base = Class.extend({ if (this._searchInput.getTagName() === 'input') { this._searchInput.attr('autocomplete', 'off'); } + + this._searchInput.blur($.proxy(this._blur, this)); + }, + + /** + * Closes the dropdown after a short delay. + */ + _blur: function() { + var self = this; + new WCF.PeriodicalExecuter(function(pe) { + if (self._list.is(':visible')) { + self._clearList(false); + } + + pe.stop(); + }, 100); }, /** -- 2.20.1