From 8b21d52b92a3eac13bd092793a461ed2aeadfef8 Mon Sep 17 00:00:00 2001 From: mossroy Date: Sun, 28 Jul 2013 10:56:53 +0200 Subject: [PATCH] No automatic search when the prefix is empty --- js/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index df432773..fc859b89 100644 --- a/js/app.js +++ b/js/app.js @@ -169,7 +169,13 @@ define(function(require) { if(window.timeoutKeyUpPrefix) { window.clearTimeout(window.timeoutKeyUpPrefix); } - window.timeoutKeyUpPrefix = window.setTimeout("document.getElementById('searchTitles').click()",500); + window.timeoutKeyUpPrefix = window.setTimeout(function() { + var prefix = $("#prefix").val(); + if (prefix && prefix.length>0) { + $('#searchTitles').click(); + } + } + ,500); }