From 7fc9c5aabb077ff4cc4cf8bad84e11b3de776fee Mon Sep 17 00:00:00 2001
From: Mark Schouten <mark@tuxis.nl>
Date: Wed, 5 Nov 2014 09:22:57 +0100
Subject: [PATCH] Implement a 400ms delay in the searchbar

---
 index.php | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/index.php b/index.php
index 53370a9..b9d9c75 100644
--- a/index.php
+++ b/index.php
@@ -627,15 +627,24 @@ $(document).ready(function () {
     $('#domsearch').addClear({
         onClear: function() { $('#MasterZones').jtable('load'); }
     });
-    $('#domsearch').on('input', function (e) {
-        e.preventDefault();
+
+    function searchDoms() {
         $('#MasterZones').jtable('load', {
             domsearch: $('#domsearch').val()
         });
         $('#SlaveZones').jtable('load', {
             domsearch: $('#domsearch').val()
         });
+    }
+
+    stimer = 0;
+
+    $('#domsearch').on('input', function (e) {
+        e.preventDefault();
+        clearTimeout(stimer);
+        stimer = setTimeout(searchDoms, 400);
     });
+
     <? if (is_adminuser()) { ?>
     $('#Users').hide();
     $('#useradmin').click(function () {